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-2011, 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. --  The Gtk_Fixed widget is a container which can place child widgets at fixed 
  27. --  positions and with fixed sizes, given in pixels. 
  28. -- 
  29. --  Note that it is usually bad practice to use the Gtk_Fixed container in 
  30. --  GtkAda. Instead, you should consider using one of the other many containers 
  31. --  available, that will allow you to handle resizing of your windows, as well 
  32. --  as font size changes easily. 
  33. -- 
  34. --  </description> 
  35. --  <screenshot>gtk-fixed</screenshot> 
  36. --  <group>Layout containers</group> 
  37. --  <testgtk>create_fixed.adb</testgtk> 
  38.  
  39. pragma Warnings (Off, "*is already use-visible*"); 
  40. with Glib;          use Glib; 
  41. with Glib.Types;    use Glib.Types; 
  42. with Gtk.Buildable; use Gtk.Buildable; 
  43. with Gtk.Container; use Gtk.Container; 
  44. with Gtk.Widget;    use Gtk.Widget; 
  45.  
  46. package Gtk.Fixed is 
  47.  
  48.    type Gtk_Fixed_Record is new Gtk_Container_Record with null record; 
  49.    type Gtk_Fixed is access all Gtk_Fixed_Record'Class; 
  50.  
  51.    ------------------ 
  52.    -- Constructors -- 
  53.    ------------------ 
  54.  
  55.    procedure Gtk_New (Fixed : out Gtk_Fixed); 
  56.    procedure Initialize (Fixed : access Gtk_Fixed_Record'Class); 
  57.  
  58.    function Get_Type return Glib.GType; 
  59.    pragma Import (C, Get_Type, "gtk_fixed_get_type"); 
  60.  
  61.    ------------- 
  62.    -- Methods -- 
  63.    ------------- 
  64.  
  65.    function Get_Has_Window (Fixed : access Gtk_Fixed_Record) return Boolean; 
  66.    pragma Obsolescent (Get_Has_Window); 
  67.    procedure Set_Has_Window 
  68.       (Fixed      : access Gtk_Fixed_Record; 
  69.        Has_Window : Boolean := False); 
  70.    pragma Obsolescent (Set_Has_Window); 
  71.    --  Sets whether a Gtk.Fixed.Gtk_Fixed widget is created with a separate 
  72.    --  Gdk.Window.Gdk_Window for Widget->window or not. (By default, it will be 
  73.    --  created with no separate Gdk.Window.Gdk_Window). This function must be 
  74.    --  called while the Gtk.Fixed.Gtk_Fixed is not realized, for instance, 
  75.    --  immediately after the window is created. This function was added to 
  76.    --  provide an easy migration path for older applications which may expect 
  77.    --  Gtk.Fixed.Gtk_Fixed to have a separate window. 
  78.    --  Deprecated since 2.20, Use Gtk.Widget.Set_Has_Window instead. 
  79.    --  "has_window": True if a separate window should be created 
  80.  
  81.    procedure Move 
  82.       (Fixed  : access Gtk_Fixed_Record; 
  83.        Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 
  84.        X      : Gint; 
  85.        Y      : Gint); 
  86.    --  Move a child of a GtkFixed container to the given position. X indicates 
  87.    --  the horizontal position to place the widget at. Y is the vertical 
  88.    --  position to place the widget at. 
  89.  
  90.    procedure Put 
  91.       (Fixed  : access Gtk_Fixed_Record; 
  92.        Widget : access Gtk.Widget.Gtk_Widget_Record'Class; 
  93.        X      : Gint; 
  94.        Y      : Gint); 
  95.    --  Add Widget to a Fixed container at the given position. X indicates the 
  96.    --  horizontal position to place the widget at. Y is the vertical position 
  97.    --  to place the widget at. 
  98.  
  99.    ---------------- 
  100.    -- Interfaces -- 
  101.    ---------------- 
  102.    --  This class implements several interfaces. See Glib.Types 
  103.    -- 
  104.    --  - "Buildable" 
  105.  
  106.    package Implements_Buildable is new Glib.Types.Implements 
  107.      (Gtk.Buildable.Gtk_Buildable, Gtk_Fixed_Record, Gtk_Fixed); 
  108.    function "+" 
  109.      (Widget : access Gtk_Fixed_Record'Class) 
  110.    return Gtk.Buildable.Gtk_Buildable 
  111.    renames Implements_Buildable.To_Interface; 
  112.    function "-" 
  113.      (Interf : Gtk.Buildable.Gtk_Buildable) 
  114.    return Gtk_Fixed 
  115.    renames Implements_Buildable.To_Object; 
  116.  
  117. end Gtk.Fixed;