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

/src/wrappers/gtk/examples/expander/my_expander.e

http://github.com/tybor/Liberty
Specman e | 31 lines | 30 code | 1 blank | 0 comment | 2 complexity | f92e25d384d256dd50e9233a3ceb9af5 MD5 | raw file
 1class MY_EXPANDER
 2inherit
 3	GTK_EXPANDER
 4		rename make as make_expander
 5		export {} make_expander
 6		redefine on_activate			
 7		end
 8creation make
 9feature make (a_statusbar: GTK_STATUS_BAR) is
10		require valid_statusbar: a_statusbar/=Void
11		do
12			statusbar:= a_statusbar
13			make_with_mnemonic (expander_label)
14			enable_on_activate
15		end
16
17	on_activate is
18		require statusbar_set: statusbar /= Void
19		do
20			if not statusbar.is_empty then
21				statusbar.pop
22			end
23			if is_expanded then
24				statusbar.push ("The expander clicked when it was expanded.")
25			else
26				statusbar.push ("The expander clicked when it was collapsed.")
27			end
28		end
29	statusbar: GTK_STATUS_BAR
30	expander_label: STRING is "_An expander"
31end