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