PageRenderTime 16ms CodeModel.GetById 11ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/wrappers/gtk/library/select_all_callback.e

http://github.com/tybor/Liberty
Specman e | 68 lines | 52 code | 16 blank | 0 comment | 3 complexity | d1870901d119216253e2cf6d907c020b MD5 | raw file
 1indexing
 2	description: "Generic callback for the select-all signal"
 3	copyright: "[
 4					Copyright (C) 2006 Paolo redaelli, eiffel-libraries team,  GTK+ team and others
 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	license: "LGPL v2 or later"
22	date: "$Date:$"
23	revision "$Revision:$"
24
25class SELECT_ALL_CALLBACK
26
27inherit CALLBACK redefine object end
28
29insert G_OBJECT_FACTORY [GTK_TEXT_VIEW]
30
31creation make
32
33feature
34
35	object: GTK_TEXT_VIEW
36
37feature
38
39	callback (select_all: INTEGER; instance: POINTER) is
40		require
41			instance_not_null: instance.is_not_null
42		do
43			object := wrapper(instance)
44			procedure.call ([object, select_all.to_boolean])
45		end
46
47	callback_pointer: POINTER is
48		do
49			Result := get_callback_pointer ($callback)
50		ensure
51			Result.is_not_null
52		end
53
54	connect (an_object: like object; a_procedure: like procedure) is
55		require
56			an_object /= Void
57			a_procedure /= Void
58		do
59			handler_id := g_signal_connect_closure (an_object.handle, signal_name.to_external,
60																 handle, 0) -- i.e. call it before default handler
61			procedure := a_procedure
62		end
63
64	signal_name: STRING is "select-all"
65
66	procedure: PROCEDURE [ANY, TUPLE [like object, BOOLEAN]]
67
68end -- class SELECT_ALL_CALLBACK