File: quit_cmd.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-- 805 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
indexing
	description: "Quit program when quit event received"
	author: "Dave E Martin XXIII"
	license: "Eiffel Forum"
	genesis: "199901210400 utc"
	version: "v 0.3.5 GTK+ 1.2.x"
	gtk_version: "1.2"

class
	QUIT_CMD
inherit
	GTK_COMMAND
creation
	make,
	make_destroy
feature -- initialization
	make (widget: GTK_WIDGET; app: GTK_APPLICATION) is
		do
			application := app
			connect ("delete_event", widget)
			!! destroy.make_destroy (widget, app)
		ensure
			destroy_handled: destroy /= Void
		end
feature {NONE} -- implementation
	execute is
		do
			application.main_loop_quit
		end
	application: GTK_APPLICATION
	destroy: QUIT_CMD
	make_destroy (widget: GTK_WIDGET; app: GTK_APPLICATION) is
		do
			application := app
			connect ("destroy", widget)
		ensure
			not_recursive: destroy = Void
		end
end