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

/src/wrappers/gtk/examples/dnd/gdk_events.e

http://github.com/tybor/Liberty
Specman e | 53 lines | 30 code | 8 blank | 15 comment | 0 complexity | e1e77e34c21e51352144ea7b1d94bff9 MD5 | raw file
 1class GDK_EVENTS
 2
 3insert
 4	ANY
 5	GTK
 6	GDK_EVENT_MASK
 7
 8creation
 9	make
10
11feature
12
13	on_delete_event (a_gtk_object: GTK_OBJECT) is
14		do
15			gtk.quit
16		end
17
18	motion_notified (an_event_motion: GDK_EVENT_MOTION; a_widget: GTK_WIDGET): BOOLEAN is
19		do
20			print ("(" + an_event_motion.x.to_string + ", " + an_event_motion.y.to_string + ")%N")
21		end
22
23	make is
24		local
25			event_box: GTK_EVENT_BOX
26		do
27			gtk.initialize
28			-- Create and configure window
29			create window.make
30			window.set_default_size (280, 190)
31			window.connect_agent_to_destroy_signal (agent on_delete_event)
32			window.set_border_width (20)
33
34			-- Create and configure event box
35			create event_box.make
36			window.add (event_box)
37			event_box.add_events (gdk_button1_motion_mask) -- If you want hints: .bit_or (gdk_pointer_motion_hint_mask))
38			event_box.connect_agent_to_motion_notify_event_signal (agent motion_notified)
39
40			create label.with_markup_label ("<span font_desc='Sans Italic Bold 20'>Hello World!</span>")
41			event_box.add (label)
42
43			window.show_all
44
45			gtk.run_main_loop
46
47		end
48
49	window: GTK_WINDOW
50
51	label: GTK_LABEL
52
53end -- class GDK_EVENTS