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