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. --  The Gtk_Fixed widget is a container which can place child widgets at fixed 
  33. --  positions and with fixed sizes, given in pixels. 
  34. -- 
  35. --  Note that it is usually bad practice to use the Gtk_Fixed container in 
  36. --  GtkAda. Instead, you should consider using one of the other many containers 
  37. --  available, that will allow you to handle resizing of your windows, as well 
  38. --  as font size changes easily. 
  39. -- 
  40. --  </description> 
  41. --  <c_version>2.8.17</c_version> 
  42. --  <group>Layout containers</group> 
  43. --  <testgtk>create_fixed.adb</testgtk> 
  44. --  <screenshot>gtk-fixed</screenshot> 
  45.  
  46. with Glib.Properties; 
  47. with Gtk.Container; 
  48. with Gtk.Widget; 
  49.  
  50. package Gtk.Fixed is 
  51.  
  52.    type Gtk_Fixed_Record is new 
  53.      Gtk.Container.Gtk_Container_Record with private; 
  54.    type Gtk_Fixed is access all Gtk_Fixed_Record'Class; 
  55.  
  56.    procedure Gtk_New (Fixed : out Gtk_Fixed); 
  57.    --  Create a new fixed container. 
  58.  
  59.    procedure Initialize (Fixed : access Gtk_Fixed_Record'Class); 
  60.    --  Internal initialization function. 
  61.    --  See the section "Creating your own widgets" in the documentation. 
  62.  
  63.    function Get_Type return Gtk.Gtk_Type; 
  64.    --  Return the internal value associated with a Gtk_Fixed. 
  65.  
  66.    procedure Put 
  67.      (Fixed  : access Gtk_Fixed_Record; 
  68.       Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 
  69.       X      : Gint; 
  70.       Y      : Gint); 
  71.    --  Add Widget to a Fixed container at the given position. 
  72.    --  X indicates the horizontal position to place the widget at. 
  73.    --  Y is the vertical position to place the widget at. 
  74.  
  75.    procedure Move 
  76.      (Fixed  : access Gtk_Fixed_Record; 
  77.       Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 
  78.       X      : Gint; 
  79.       Y      : Gint); 
  80.    --  Move a child of a GtkFixed container to the given position. 
  81.    --  X indicates the horizontal position to place the widget at. 
  82.    --  Y is the vertical position to place the widget at. 
  83.  
  84.    procedure Set_Has_Window 
  85.      (Fixed      : access Gtk_Fixed_Record; 
  86.       Has_Window : Boolean := False); 
  87.    function Get_Has_Window (Fixed : access Gtk_Fixed_Record) return Boolean; 
  88.    --  Sets whether a Gtk_Fixed widget is created with a separate 
  89.    --  Gdk_Window for or not. (By default, it will be created with no 
  90.    --  separate Gdk_Window). This function must be called while the widget 
  91.    --  is not realized, for instance, immediately after the window is created. 
  92.  
  93.    ---------------------- 
  94.    -- Child Properties -- 
  95.    ---------------------- 
  96.    --  The following properties can be set on children of this widget. See 
  97.    --  in particular Gtk.Containers.Child_Set_Property. 
  98.  
  99.    --  <child_properties> 
  100.    --  Name:  X_Property 
  101.    --  Type:  Int 
  102.    --  Descr: X position of child widget 
  103.    -- 
  104.    --  Name:  Y_Property 
  105.    --  Type:  Int 
  106.    --  Descr: Y position of child widget 
  107.    --  </child_properties> 
  108.  
  109.    X_Property : constant Glib.Properties.Property_Int; 
  110.    Y_Property : constant Glib.Properties.Property_Int; 
  111.  
  112. private 
  113.    type Gtk_Fixed_Record is new Gtk.Container.Gtk_Container_Record 
  114.      with null record; 
  115.  
  116.  
  117.    X_Property : constant Glib.Properties.Property_Int := 
  118.      Glib.Properties.Build ("x"); 
  119.    Y_Property : constant Glib.Properties.Property_Int := 
  120.      Glib.Properties.Build ("y"); 
  121.  
  122.    pragma Import (C, Get_Type, "gtk_fixed_get_type"); 
  123. end Gtk.Fixed;