File: button_press_command.e

package info (click to toggle)
egtk 0.3.6-8
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,984 kB
  • ctags: 5,256
  • sloc: ansic: 2,320; sh: 273; makefile: 234
file content (39 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class BUTTON_PRESS_COMMAND

inherit

	GDK_EVENT_COMMAND

	GDK_CONSTANTS

creation

	make

feature

	make (button: GTK_BUTTON; menu: GTK_MENU) is
		require
			button_exists: button /= Void
			menu_exists: menu /= Void
		do
			-- connect ("clicked", button)
			button.add_action ("event", Current)
			menu_to_popup := menu
		end

	menu_to_popup: GTK_MENU

	execute is
		local
			bevent: GDK_EVENT_BUTTON
		do
			bevent ?= event
			if bevent /= Void then
				menu_to_popup.popup (Void, Void, bevent.button, bevent.time)
				last_event_handled := True
			end
		end

end