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

/tutorial/vision/hello_world/hello.e

http://github.com/tybor/Liberty
Specman e | 38 lines | 22 code | 5 blank | 11 comment | 0 complexity | 6e85e7039083f521485ed75f3f0b54a6 MD5 | raw file
 1class HELLO
 2	-- This example show:
 3	-- how to create a window, chose title and colors,
 4	-- how to add widgets into the window,
 5	-- how to start and stop the event loop.
 6
 7inherit
 8	GRAPHIC
 9		-- Give access to constants (vision, colors...)
10
11creation {ANY}
12	make
13
14feature {}
15	toplevel_window: TOPLEVEL_WINDOW
16
17	make is
18		local
19			label: LABEL
20		do
21			create toplevel_window.default_create
22			toplevel_window.set_title("Hello World")
23			toplevel_window.set_background_color(white_color)
24			toplevel_window.map
25			-- put the window on the screen; may be done later
26			create label.make(U"Hello World !")
27			-- windows are containers, you add widgets into them
28			toplevel_window.child_attach(label)
29			-- register procedure to call on user requests on 'quit'
30			toplevel_window.when_close_requested(agent vision.loop_stack.break)
31			-- start the event loop. The event loop executes registred
32			-- behavior for user actions.
33			-- It will stop when break is called (vision.loop_stack.break).
34			vision.start
35			io.put_string("The end%N")
36		end
37
38end -- class HELLO