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. -- As a special exception, if other files instantiate generics from  -- 
  23. -- this unit, or you link this unit with other files to produce an   -- 
  24. -- executable, this  unit  does not  by itself cause  the resulting  -- 
  25. -- executable to be covered by the GNU General Public License. This  -- 
  26. -- exception does not however invalidate any other reasons why the   -- 
  27. -- executable file  might be covered by the  GNU Public License.     -- 
  28. ----------------------------------------------------------------------- 
  29.  
  30. --  <description> 
  31. -- 
  32. --  This widget is a container that catches events for its child when its 
  33. --  child does not have its own window (like a Gtk_Scrolled_Window or a 
  34. --  Gtk_Label for instance). 
  35. --  Some widgets in GtkAda do not have their own window, and thus can not 
  36. --  directly get events from the server. The Gtk_Event_Box widget can be 
  37. --  used to force its child to receive events anyway. 
  38. -- 
  39. --  For instance, this widget is used internally in a Gtk_Combo_Box so that 
  40. --  the application can change the cursor when the mouse is in the popup 
  41. --  window. In that case, it contains a frame, that itself contains the 
  42. --  scrolled window of the popup. 
  43. -- 
  44. --  </description> 
  45. --  <c_version>2.8.17</c_version> 
  46. --  <group>Layout containers</group> 
  47.  
  48. with Glib.Properties; 
  49. with Gtk.Bin; 
  50.  
  51. package Gtk.Event_Box is 
  52.  
  53.    type Gtk_Event_Box_Record is new Gtk.Bin.Gtk_Bin_Record with private; 
  54.    type Gtk_Event_Box is access all Gtk_Event_Box_Record'Class; 
  55.  
  56.    procedure Gtk_New (Event_Box : out Gtk_Event_Box); 
  57.    --  Create a new box. 
  58.    --  The box's child can then be set using the Gtk.Container.Add function. 
  59.  
  60.    procedure Initialize (Event_Box : access Gtk_Event_Box_Record'Class); 
  61.    --  Internal initialization function. 
  62.    --  See the section "Creating your own widgets" in the documentation. 
  63.  
  64.    function Get_Type return Gtk.Gtk_Type; 
  65.    --  Return the internal value associated with a Gtk_Event_Box. 
  66.  
  67.    procedure Set_Visible_Window 
  68.       (Event_Box : access Gtk_Event_Box_Record; 
  69.        Visible_Window : Boolean); 
  70.    function Get_Visible_Window 
  71.       (Event_Box : access Gtk_Event_Box_Record) return Boolean; 
  72.    --  Set whether the event box uses a visible or invisible child window. The 
  73.    --  default is to use visible windows 
  74.    --  Except if you want to explicitly change the background, or explicitly 
  75.    --  draw on it, you should make the event box invisible. 
  76.  
  77.    procedure Set_Above_Child 
  78.       (Event_Box : access Gtk_Event_Box_Record; 
  79.        Above_Child : Boolean); 
  80.    function Get_Above_Child 
  81.       (Event_Box : access Gtk_Event_Box_Record) return Boolean; 
  82.    --  Set whether the event box window is positioned above the windows of its 
  83.    --  child, as opposed to below it. If the window is above, all events inside 
  84.    --  the event box will go to the event box. If the window is below, events 
  85.    --  in windows of child widgets will first go to that widget, and then to 
  86.    --  its parent. The default is to keep the window below the child. 
  87.  
  88.    ---------------- 
  89.    -- Properties -- 
  90.    ---------------- 
  91.  
  92.    --  <properties> 
  93.    --  The following properties are defined for this widget. See 
  94.    --  Glib.Properties for more information on properties. 
  95.    -- 
  96.    --  Name:  Above_Child_Property 
  97.    --  Type:  Boolean 
  98.    --  Descr: Whether the event-trapping window of the eventbox is above the 
  99.    --         window of the child widget as opposed to below it. 
  100.    -- 
  101.    --  Name:  Visible_Window_Property 
  102.    --  Type:  Boolean 
  103.    --  Descr: Whether the event box is visible, as opposed to invisible and 
  104.    --         only used to trap events. 
  105.    -- 
  106.    --  </properties> 
  107.  
  108.    Above_Child_Property    : constant Glib.Properties.Property_Boolean; 
  109.    Visible_Window_Property : constant Glib.Properties.Property_Boolean; 
  110.  
  111.    ------------- 
  112.    -- Signals -- 
  113.    ------------- 
  114.  
  115.    --  <signals> 
  116.    --  The following new signals are defined for this widget: 
  117.    --  </signals> 
  118.  
  119. private 
  120.    type Gtk_Event_Box_Record is new Gtk.Bin.Gtk_Bin_Record with null record; 
  121.  
  122.    Above_Child_Property : constant Glib.Properties.Property_Boolean := 
  123.      Glib.Properties.Build ("above-child"); 
  124.    Visible_Window_Property : constant Glib.Properties.Property_Boolean := 
  125.      Glib.Properties.Build ("visible-window"); 
  126.  
  127.    pragma Import (C, Get_Type, "gtk_event_box_get_type"); 
  128. end Gtk.Event_Box;