/src/wrappers/gtk/library/gtk_event_box.e

http://github.com/tybor/Liberty · Specman e · 117 lines · 51 code · 16 blank · 50 comment · 2 complexity · 08d94bfc1dc5964a1c5647c16aa52b87 MD5 · raw file

  1. indexing
  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. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public License
  7. as published by the Free Software Foundation; either version 2.1 of
  8. the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful, but
  10. WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  16. 02110-1301 USA
  17. ]"
  18. date: "$Date:$"
  19. revision: "$Revision:$"
  20. class GTK_EVENT_BOX
  21. -- The GtkEventBox widget is a subclass of GtkBin which also has
  22. -- its own window. It is useful since it allows you to catch events
  23. -- for widgets which do not have their own window.
  24. inherit GTK_BIN
  25. -- GtkEventBox implements AtkImplementorIface.
  26. insert GTK_EVENT_BOX_EXTERNALS
  27. creation make, from_external_pointer
  28. feature -- size
  29. struct_size: INTEGER is
  30. external "C inline use <gtk/gtk.h>"
  31. alias "sizeof(GtkEventBox)"
  32. end
  33. feature {} -- Creation
  34. make is
  35. -- Creates a new GtkEventBox.
  36. do
  37. from_external_pointer (gtk_event_box_new)
  38. end
  39. feature -- Operations
  40. set_above_child(above: BOOLEAN) is
  41. -- Set whether the event box window is positioned above the
  42. -- windows of its child, as opposed to below it. If the
  43. -- window is above, all events inside the event box will
  44. -- go to the event box. If the window is below, events in
  45. -- windows of child widgets will first got to that widget,
  46. -- and then to its parents.
  47. --
  48. -- The default is to keep the window below the child.
  49. do
  50. gtk_event_box_set_above_child(handle, above.to_integer)
  51. end
  52. above_child: BOOLEAN is
  53. -- Returns whether the event box window is above or below
  54. -- the windows of its child. See set_above_child() for details.
  55. do
  56. Result := gtk_event_box_get_above_child (handle).to_boolean
  57. end
  58. set_visible_window (a_visible: BOOLEAN) is
  59. -- Set whether the event box uses a visible or invisible child
  60. -- window. The default is to use visible windows.
  61. --
  62. -- In an invisible window event box, the window that that the
  63. -- event box creates is a GDK_INPUT_ONLY window, which means
  64. -- that it is invisible and only serves to receive events.
  65. --
  66. -- A visible window event box creates a visible (GDK_INPUT_OUTPUT)
  67. -- window that acts as the parent window for all the widgets
  68. -- contained in the event box.
  69. --
  70. -- You should generally make your event box invisible if you
  71. -- just want to trap events. Creating a visible window may
  72. -- cause artifacts that are visible to the user, especially
  73. -- if the user is using a theme with gradients or pixmaps.
  74. --
  75. -- The main reason to create a non input-only event box is if
  76. -- you want to set the background to a different color or draw
  77. -- on it.
  78. --
  79. -- Note: There is one unexpected issue for an invisible event
  80. -- box that has its window below the child. (See set_above_child)
  81. -- Since the input-only window is not an ancestor window of any
  82. -- windows that descendent widgets of the event box create,
  83. -- events on these windows aren't propagated up by the windowing
  84. -- system, but only by GTK+. The practical effect of this is if
  85. -- an event isn't in the event mask for the descendant window
  86. -- (add_events()), it won't be received by the event box.
  87. --
  88. -- This problem doesn't occur for visible event boxes, because
  89. -- in that case, the event box window is actually the ancestor
  90. -- of the descendant windows, not just at the same place on the
  91. -- screen.
  92. do
  93. gtk_event_box_set_visible_window(handle, a_visible.to_integer)
  94. end
  95. visible_window: BOOLEAN is
  96. -- Returns whether the event box has a visible window.
  97. -- See set_visible_window() for details.
  98. do
  99. Result := gtk_event_box_get_visible_window(handle).to_boolean
  100. end
  101. end