PageRenderTime 8ms CodeModel.GetById 2ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gtk/examples/entries/entries_window.e

http://github.com/tybor/Liberty
Specman e | 60 lines | 52 code | 5 blank | 3 comment | 0 complexity | 0a5ee1364f135c6db33616c5effe8a0d MD5 | raw file
 1class ENTRIES_WINDOW
 2inherit
 3	GTK_WINDOW redefine make, on_destroy end
 4insert
 5	G_SIGNALS
 6	GTK
 7creation make
 8feature make is
 9		do
10			Precursor
11			check is_entries_window_a_g_object: g_is_object (handle) /= 0 end
12			set_title (title_string)
13			midscreen
14			create vbox.make (True,10)
15			create entry_box.make (True,10)
16			create integer_spin_box.make (True,10)
17			create real_spin_box.make (True,10)
18			vbox.add (entry_box) 
19			vbox.add (integer_spin_box) 
20			vbox.add (real_spin_box) 
21			add (vbox)
22
23			-- Setting entry
24			create entry_label.with_label ("My entry")
25			entry_label.set_angle (25.0)
26			entry_box.pack_start_defaults (entry_label)			
27			create entry.with_label ("What a nice entry!")
28			entry_box.pack_start_defaults (entry)
29
30			-- Setting integer spin button
31			create integer_spin_label.with_label ("Number of Eiffel projects")
32			create integer_spin.make
33			integer_spin_box.pack_start_defaults (integer_spin_label)
34			integer_spin_box.pack_start_defaults (integer_spin)
35			
36			-- Setting integer spin button
37			create real_spin_label.with_label ("Amount of non-Eiffel code (percent)")
38			create real_spin.make
39			real_spin_box.pack_start_defaults (real_spin_label)
40			real_spin_box.pack_start_defaults (real_spin)
41
42			enable_on_destroy
43		end
44feature -- labels
45	title_string: STRING is "Entries demo"
46feature -- Widgets
47	vbox: GTK_VBOX
48	entry_box, integer_spin_box, real_spin_box: GTK_HBOX
49	entry_label, integer_spin_label, real_spin_label: GTK_LABEL
50	entry: TEXT_ENTRY
51	integer_spin: INTEGER_SPIN
52	real_spin: REAL_SPIN
53	
54feature -- Callbacks
55	on_destroy is
56		do
57			print ("Entries demo ending%N")
58			gtk.quit
59		end
60end