/src/wrappers/gtk/library/gtk_event_box.e
Specman e | 117 lines | 51 code | 16 blank | 50 comment | 2 complexity | 08d94bfc1dc5964a1c5647c16aa52b87 MD5 | raw file
1indexing 2 description: "GtkEventBox -- A widget used to catch events for widgets which do not have their own window." 3 copyright: "[ 4 Copyright (C) 2006 eiffel-libraries team, GTK+ 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 date: "$Date:$" 22 revision: "$Revision:$" 23 24class GTK_EVENT_BOX 25 -- The GtkEventBox widget is a subclass of GtkBin which also has 26 -- its own window. It is useful since it allows you to catch events 27 -- for widgets which do not have their own window. 28 29inherit GTK_BIN 30-- GtkEventBox implements AtkImplementorIface. 31 32insert GTK_EVENT_BOX_EXTERNALS 33 34creation make, from_external_pointer 35 36 37feature -- size 38 struct_size: INTEGER is 39 external "C inline use <gtk/gtk.h>" 40 alias "sizeof(GtkEventBox)" 41 end 42 43feature {} -- Creation 44 make is 45 -- Creates a new GtkEventBox. 46 do 47 from_external_pointer (gtk_event_box_new) 48 end 49 50feature -- Operations 51 52 set_above_child(above: BOOLEAN) is 53 -- Set whether the event box window is positioned above the 54 -- windows of its child, as opposed to below it. If the 55 -- window is above, all events inside the event box will 56 -- go to the event box. If the window is below, events in 57 -- windows of child widgets will first got to that widget, 58 -- and then to its parents. 59 -- 60 -- The default is to keep the window below the child. 61 do 62 gtk_event_box_set_above_child(handle, above.to_integer) 63 end 64 65 above_child: BOOLEAN is 66 -- Returns whether the event box window is above or below 67 -- the windows of its child. See set_above_child() for details. 68 do 69 Result := gtk_event_box_get_above_child (handle).to_boolean 70 end 71 72 set_visible_window (a_visible: BOOLEAN) is 73 -- Set whether the event box uses a visible or invisible child 74 -- window. The default is to use visible windows. 75 -- 76 -- In an invisible window event box, the window that that the 77 -- event box creates is a GDK_INPUT_ONLY window, which means 78 -- that it is invisible and only serves to receive events. 79 -- 80 -- A visible window event box creates a visible (GDK_INPUT_OUTPUT) 81 -- window that acts as the parent window for all the widgets 82 -- contained in the event box. 83 -- 84 -- You should generally make your event box invisible if you 85 -- just want to trap events. Creating a visible window may 86 -- cause artifacts that are visible to the user, especially 87 -- if the user is using a theme with gradients or pixmaps. 88 -- 89 -- The main reason to create a non input-only event box is if 90 -- you want to set the background to a different color or draw 91 -- on it. 92 -- 93 -- Note: There is one unexpected issue for an invisible event 94 -- box that has its window below the child. (See set_above_child) 95 -- Since the input-only window is not an ancestor window of any 96 -- windows that descendent widgets of the event box create, 97 -- events on these windows aren't propagated up by the windowing 98 -- system, but only by GTK+. The practical effect of this is if 99 -- an event isn't in the event mask for the descendant window 100 -- (add_events()), it won't be received by the event box. 101 -- 102 -- This problem doesn't occur for visible event boxes, because 103 -- in that case, the event box window is actually the ancestor 104 -- of the descendant windows, not just at the same place on the 105 -- screen. 106 do 107 gtk_event_box_set_visible_window(handle, a_visible.to_integer) 108 end 109 110 visible_window: BOOLEAN is 111 -- Returns whether the event box has a visible window. 112 -- See set_visible_window() for details. 113 do 114 Result := gtk_event_box_get_visible_window(handle).to_boolean 115 end 116 117end