PageRenderTime 11ms CodeModel.GetById 3ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/src/wrappers/gtk/examples/hello/hello.e

http://github.com/tybor/Liberty
Specman e | 60 lines | 44 code | 11 blank | 5 comment | 0 complexity | e3bac4607d2db7b8ab91fb75d2646144 MD5 | raw file
 1indexing
 2	copyright: "(C) 2005 Paolo Redaelli "
 3	license: "LGPL v2 or later"
 4	date: "$Date:$"
 5	revision "$REvision:$"
 6
 7class HELLO
 8
 9insert GTK_MAIN
10	
11creation	make
12	
13feature
14	on_clicked (a_button: GTK_BUTTON) is
15		require valid_button: a_button /= Void 
16		do
17			print (once "Button `")
18			print (a_button.label)
19			print (once "' clicked%N")
20		end
21			
22feature {} -- creation
23	make is
24		local 
25			w1,w2: GTK_WIDGET; win: GTK_WINDOW; b: GTK_BUTTON 
26			rw: GTK_WINDOW; rb: GTK_BUTTON
27		do 
28			initialize
29			create window.make
30			create button.with_label (label)
31			window.set_title (title)
32			window.add (button)
33			button.connect_agent_to_clicked_signal (agent on_clicked)
34			button.show
35			window.show
36			debug
37				print ("button is at: "+button.to_pointer.to_string+"%N")
38			end
39			check
40--				window = r.wrapper(window.handle)
41         end
42			
43			run_main_loop -- instead of "gtk_main"
44		end
45feature -- Disposing
46	
47feature
48	window: MY_WINDOW
49			-- the window
50	title: STRING is "Wow my first Eiffel window!"
51			-- window title
52	button: MY_BUTTON
53			-- the button
54	label: STRING is "Hello world from eiffel-gtk!"
55			-- button's label
56
57end
58	
59	
60