1. ----------------------------------------------------------------------- 
  2. --               GtkAda - Ada95 binding for Gtk+/Gnome               -- 
  3. --                                                                   -- 
  4. --   Copyright (C) 1998-2000 E. Briot, J. Brobecker and A. Charlet   -- 
  5. --                Copyright (C) 2000-2006 AdaCore                    -- 
  6. --                                                                   -- 
  7. -- This library is free software; you can redistribute it and/or     -- 
  8. -- modify it under the terms of the GNU General Public               -- 
  9. -- License as published by the Free Software Foundation; either      -- 
  10. -- version 2 of the License, or (at your option) any later version.  -- 
  11. --                                                                   -- 
  12. -- This library is distributed in the hope that it will be useful,   -- 
  13. -- but WITHOUT ANY WARRANTY; without even the implied warranty of    -- 
  14. -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU -- 
  15. -- General Public License for more details.                          -- 
  16. --                                                                   -- 
  17. -- You should have received a copy of the GNU General Public         -- 
  18. -- License along with this library; if not, write to the             -- 
  19. -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      -- 
  20. -- Boston, MA 02111-1307, USA.                                       -- 
  21. --                                                                   -- 
  22. -- -- -- -- -- -- -- -- -- -- -- --
  23. ----------------------------------------------------------------------- 
  24.  
  25. --  <description> 
  26. -- 
  27. --  This widget is a container that catches events for its child when its 
  28. --  child does not have its own window (like a Gtk_Scrolled_Window or a 
  29. --  Gtk_Label for instance). 
  30. --  Some widgets in GtkAda do not have their own window, and thus can not 
  31. --  directly get events from the server. The Gtk_Event_Box widget can be 
  32. --  used to force its child to receive events anyway. 
  33. -- 
  34. --  For instance, this widget is used internally in a Gtk_Combo_Box so that 
  35. --  the application can change the cursor when the mouse is in the popup 
  36. --  window. In that case, it contains a frame, that itself contains the 
  37. --  scrolled window of the popup. 
  38. -- 
  39. --  </description> 
  40. --  <c_version>2.8.17</c_version> 
  41. --  <group>Layout containers</group> 
  42.  
  43. with Glib.Properties; 
  44. with Gtk.Bin; 
  45.  
  46. package Gtk.Event_Box is 
  47.  
  48.    type Gtk_Event_Box_Record is new Gtk.Bin.Gtk_Bin_Record with private; 
  49.    type Gtk_Event_Box is access all Gtk_Event_Box_Record'Class; 
  50.  
  51.    procedure Gtk_New (Event_Box : out Gtk_Event_Box); 
  52.    --  Create a new box. 
  53.    --  The box's child can then be set using the Gtk.Container.Add function. 
  54.  
  55.    procedure Initialize (Event_Box : access Gtk_Event_Box_Record'Class); 
  56.    --  Internal initialization function. 
  57.    --  See the section "Creating your own widgets" in the documentation. 
  58.  
  59.    function Get_Type return Gtk.Gtk_Type; 
  60.    --  Return the internal value associated with a Gtk_Event_Box. 
  61.  
  62.    procedure Set_Visible_Window 
  63.       (Event_Box : access Gtk_Event_Box_Record; 
  64.        Visible_Window : Boolean); 
  65.    function Get_Visible_Window 
  66.       (Event_Box : access Gtk_Event_Box_Record) return Boolean; 
  67.    --  Set whether the event box uses a visible or invisible child window. The 
  68.    --  default is to use visible windows 
  69.    --  Except if you want to explicitly change the background, or explicitly 
  70.    --  draw on it, you should make the event box invisible. 
  71.  
  72.    procedure Set_Above_Child 
  73.       (Event_Box : access Gtk_Event_Box_Record; 
  74.        Above_Child : Boolean); 
  75.    function Get_Above_Child 
  76.       (Event_Box : access Gtk_Event_Box_Record) return Boolean; 
  77.    --  Set whether the event box window is positioned above the windows of its 
  78.    --  child, as opposed to below it. If the window is above, all events inside 
  79.    --  the event box will go to the event box. If the window is below, events 
  80.    --  in windows of child widgets will first go to that widget, and then to 
  81.    --  its parent. The default is to keep the window below the child. 
  82.  
  83.    ---------------- 
  84.    -- Properties -- 
  85.    ---------------- 
  86.  
  87.    --  <properties> 
  88.    --  The following properties are defined for this widget. See 
  89.    --  Glib.Properties for more information on properties. 
  90.    -- 
  91.    --  Name:  Above_Child_Property 
  92.    --  Type:  Boolean 
  93.    --  Descr: Whether the event-trapping window of the eventbox is above the 
  94.    --         window of the child widget as opposed to below it. 
  95.    -- 
  96.    --  Name:  Visible_Window_Property 
  97.    --  Type:  Boolean 
  98.    --  Descr: Whether the event box is visible, as opposed to invisible and 
  99.    --         only used to trap events. 
  100.    -- 
  101.    --  </properties> 
  102.  
  103.    Above_Child_Property    : constant Glib.Properties.Property_Boolean; 
  104.    Visible_Window_Property : constant Glib.Properties.Property_Boolean; 
  105.  
  106.    ------------- 
  107.    -- Signals -- 
  108.    ------------- 
  109.  
  110.    --  <signals> 
  111.    --  The following new signals are defined for this widget: 
  112.    --  </signals> 
  113.  
  114. private 
  115.    type Gtk_Event_Box_Record is new Gtk.Bin.Gtk_Bin_Record with null record; 
  116.  
  117.    Above_Child_Property : constant Glib.Properties.Property_Boolean := 
  118.      Glib.Properties.Build ("above-child"); 
  119.    Visible_Window_Property : constant Glib.Properties.Property_Boolean := 
  120.      Glib.Properties.Build ("visible-window"); 
  121.  
  122.    pragma Import (C, Get_Type, "gtk_event_box_get_type"); 
  123. end Gtk.Event_Box;