PageRenderTime 23ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gtk/examples/entry_completion/entry_completion_demo.e

http://github.com/tybor/Liberty
Specman e | 69 lines | 55 code | 14 blank | 0 comment | 2 complexity | b018bd8d1810644b0b35abeb7a73d1f6 MD5 | raw file
 1indexing
 2	description: "Entry completion demo."
 3	copyright: "[
 4					Copyright (C) 2006 eiffel-libraries team
 5					
 6					This library is free software; you can redistribute it and/or
 7					modify it under the terms of the GNU Lesser General Public License
 8					as published by the Free Software Foundation; either version 2.1 of
 9					the License, or (at your option) any later version.
10					
11					This library is distributed in the hope that it will be useful, but
12					WITHOUT ANY WARRANTY; without even the implied warranty of
13					MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14					Lesser General Public License for more details.
15
16					You should have received a copy of the GNU Lesser General Public
17					License along with this library; if not, write to the Free Software
18					Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19					02110-1301 USA
20					]"
21
22class ENTRY_COMPLETION_DEMO
23
24insert
25	GTK
26	G_TYPES
27	ANY
28	
29creation make
30feature
31	make is
32		do
33			gtk.initialize
34			create window.make
35			window.set_title (title_string)
36			window.midscreen
37
38			create entry_box.make (True,10)
39			create entry_label.with_label ("Programmer's name:")
40			create entry.make
41			entry_box.pack_start_defaults (entry_label)
42			entry_box.pack_start_defaults (entry)
43			window.add(entry_box)
44			window.show_all
45			window.connect_agent_to_destroy_signal (agent on_destroy_window(?))
46
47			gtk.run_main_loop
48		end
49
50	on_destroy_window (an_obj: GTK_OBJECT) is
51		local a_win: GTK_WINDOW
52		do
53			a_win ::= an_obj
54			print ("Quitting%N")
55			gtk.quit
56		end
57
58feature -- labels
59	title_string: STRING is "Completion entry demo"
60	
61feature -- Widgets
62	window: GTK_WINDOW
63	entry_box: GTK_HBOX
64	entry_label: GTK_LABEL
65	entry: PROGRAMMERS_ENTRY
66	
67end
68
69