PageRenderTime 6ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gtk/examples/assistant/assistant_demo.e

http://github.com/tybor/Liberty
Specman e | 67 lines | 12 code | 2 blank | 53 comment | 0 complexity | 0f0fd300e26688ef0b89d242f58f807f MD5 | raw file
 1class ASSISTANT_DEMO
 2insert 
 3	-- TODO: Implement GTK_APPLICATION, with no undefined features; GTK
 4	-- has undefined features. Currently ANY must be inserted alongside
 5	-- with GTK in all effective classes otherwise they will contain
 6	-- undefined features, making them actually deferred.
 7	GTK 
 8	ANY 
 9
10creation make
11feature
12	make is
13		do
14			gtk.initialize
15			create assistant.make
16			
17			create front_label.with_markup_label
18			("<span size='xx-large'>Welcome to the SmartEiffel Integrated Development Enviroment!</span>\n<span size='large'>Please choose the behaviour you prefers in the following pages.</span>")
19			front_label.set_fill_justify
20			front_label.set_line_wrap
21
22			create table.make (2,2,True) 
23			create label1.with_label("Foo-ness:")
24			create label2.with_label("Bar-ness:")
25			create entry1.make entry1.set_text("Absolutely foo!")
26			create entry2.make entry2.set_text("No bars at all!")
27			table.attach_defaults(label1, 0,1,0,1)
28			table.attach_defaults(entry1, 1,2,0,1)
29			table.attach_defaults(label2, 0,1,1,2)
30			table.attach_defaults(entry2, 1,2,1,2)			
31
32			create font_chooser.make
33			create color_chooser.make
34			
35			assistant.append(front_label) 
36			assistant.append(table)
37			assistant.append(font_chooser)
38			assistant.append(color_chooser)
39
40			assistant.set_page_type(front_label, gtk_assistant_page_intro)
41			assistant.set_page_type(table,gtk_assistant_page_content)
42			assistant.set_page_type(font_chooser,gtk_assistant_page_content)
43			assistant.set_page_type(color_chooser,gtk_assistant_page_confirm)
44
45			assistant.set_page_title(front_label,"SmartEiffel IDE: first time settings")
46			assistant.set_page_title(table,"Foo and bar-ness")
47			assistant.set_page_title(font_chooser,"Default font")
48			assistant.set_page_title(color_chooser,"Default color")
49
50			assistant.set_page_complete(front_label,True)
51			assistant.set_page_complete(table,True)
52			assistant.set_page_complete(font_chooser,True)
53			assistant.set_page_complete(color_chooser,True)
54			
55			assistant.show_all
56			gtk.run_main_loop
57		end
58
59	front_label, label1, label2: GTK_LABEL
60	table: GTK_TABLE
61	entry1,entry2: GTK_ENTRY
62	font_chooser: GTK_FONT_SELECTION
63	color_chooser: GTK_COLOR_SELECTION
64	assistant: GTK_ASSISTANT
65end
66
67