## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

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-2010 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.     -----------------------------------------------------------------------

30.     --  <description>

31.     --  The Gtk_Handle_Box widget allows a portion of a window to be "torn off".

32.     --  It is a bin widget which displays its child and a handle that the user can

33.     --  drag to tear off a separate window (the float window) containing the child

34.     --  widget. A thin ghost is drawn in the original location of the handlebox. By

35.     --  dragging the separate window back to its original location, it can be

36.     --  reattached.

37.     --

38.     --  When reattaching, the ghost and float window, must be aligned along one of

39.     --  the edges, the snap edge. This either can be specified by the application

40.     --  programmer explicitely, or GtkAda will pick a reasonable default based on

41.     --  the handle position.

42.     --

43.     --  To make detaching and reattaching the handlebox as minimally confusing as

44.     --  possible to the user, it is important to set the snap edge so that the snap

45.     --  edge does not move when the handlebox is detached. For instance, if the

46.     --  handlebox is packed at the bottom of a Vbox, then when the handlebox is

47.     --  detached, the bottom edge of the handlebox's allocation will remain fixed

48.     --  as the height of the handlebox shrinks, so the snap edge should be set to

49.     --  Pos_Bottom.

50.     --  </description>

51.     --  <c_version>2.16.6</c_version>

52.     --  <group>Menus and Toolbars</group>

53.     --  <testgtk>create_handle_box.adb</testgtk>

54.     --  <screenshot>gtk-handle_box</screenshot>

56.     with Glib.PropertiesTo API docTo specTo body;

57.     with Gtk.BinTo API docTo specTo body;

58.     with Gtk.EnumsTo API docTo specTo body;

60.     package Gtk.Handle_BoxTo API docTo specTo body is

62.        type Gtk_Handle_Box_RecordTo API docTo body is new Gtk.Bin.Gtk_Bin_RecordTo API docTo spec with private;

63.        type Gtk_Handle_Box is access all Gtk_Handle_Box_RecordTo API docTo specTo body'Class;

65.        procedure Gtk_NewTo API docTo body (Handle_Box : out Gtk_Handle_BoxTo API docTo spec);

66.        --  Create a new Handle_Box.

68.        procedure InitializeTo API docTo body (Handle_Box : access Gtk_Handle_Box_RecordTo API docTo specTo body'Class);

69.        --  Internal initialization function.

70.        --  See the section "Creating your own widgets" in the documentation.

72.        function Get_TypeTo API docTo body return Gtk.Gtk_TypeTo API docTo spec;

73.        --  Return the internal value associated with a Gtk_Dialog.

75.        procedure Set_Shadow_TypeTo API docTo body

76.          (Handle_Box : access Gtk_Handle_Box_RecordTo API docTo specTo body;

77.           TypTo API docTo body        : Enums.Gtk_Shadow_TypeTo API docTo spec);

78.        function Get_Shadow_TypeTo API docTo body

79.          (Handle_Box : access Gtk_Handle_Box_RecordTo API docTo specTo body) return Enums.Gtk_Shadow_TypeTo API docTo spec;

80.        --  Sets or gets the type of shadow to be drawn around the border of the

81.        --  Handle_Box.

83.        procedure Set_Handle_PositionTo API docTo body

84.          (Handle_Box : access  Gtk_Handle_Box_RecordTo API docTo specTo body;

85.           PositionTo API docTo body   : Enums.Gtk_Position_TypeTo API docTo spec);

86.        function Get_Handle_PositionTo API docTo body

87.          (Handle_Box : access  Gtk_Handle_Box_RecordTo API docTo specTo body)

88.           return Enums.Gtk_Position_TypeTo API docTo spec;

89.        --  Sets or gets the side of the Handle_Box where the handle is drawn.

91.        procedure Set_Snap_EdgeTo API docTo body

92.          (Handle_Box : access  Gtk_Handle_Box_RecordTo API docTo specTo body;

93.           EdgeTo API docTo body       : Enums.Gtk_Position_TypeTo API docTo spec);

94.        function Get_Snap_EdgeTo API docTo body

95.          (Handle_Box : access  Gtk_Handle_Box_RecordTo API docTo specTo body)

96.           return Enums.Gtk_Position_TypeTo API docTo spec;

97.        --  Sets or gets the snap edge of a Handle_Box.

98.        --  The snap edge is the edge of the detached child that must be aligned

99.        --  with the corresponding edge of the "ghost" left behind when the child

100.        --  was detached to reattach the torn-off window. Usually, the snap edge

101.        --  should be chosen so that it stays in the same place on the screen when

102.        --  the Handle_Box is torn off.

103.        --

104.        --  If the snap edge is not set, then an appropriate value will be guessed

105.        --  from the handle position. If the handle position is Pos_Right or

106.        --  Pos_Left, then the snap edge will be Pos_Top, otherwise it will be

107.        --  Pos_Left.

109.        function Get_Child_DetachedTo API docTo body

110.          (Handle_Box : access Gtk_Handle_Box_RecordTo API docTo specTo body)

111.           return Boolean;

112.        --  Returns whether the handlebox's child is currently detached.

114.        ----------------

115.        -- Properties --

116.        ----------------

118.        --  <properties>

119.        --  The following properties are defined for this widget. See

120.        --  Glib.Properties for more information on properties.

121.        --

122.        --  - Name:  Child_Detached_Property

123.        --    Type:  Boolean

124.        --    Descr: A boolean value indicating whether the handlebox's child is

125.        --           attached or detached.

126.        --

127.        --  - Name:  Shadow_Property and Shadow_Type_Property

128.        --    Type:  Gtk_Shadow_Type

129.        --    Flags: read-write

130.        --    Descr: Appearance of the shadow that surrounds the container.

131.        --    See also: Set_Shadow_Type

132.        --

133.        --  - Name:  Handle_Position_Property

134.        --    Type:  Gtk_Position_Type

135.        --    Flags: read-write

136.        --    Descr: Position of the handle relative to the child widget.

137.        --    See also: Set_Handle_Position

138.        --

139.        --  - Name:  Snap_Edge_Property

140.        --    Type:  Gtk_Position_Type

141.        --    Flags: read-write

142.        --    Descr: Side of the handlebox that's lined up with the docking point

143.        --           to dock the handlebox.

144.        --    See also: Set_Snap_Edge

145.        --

146.        --  - Name:  Snap_Edge_Set_Property

147.        --    Type:  Boolean

148.        --    Descr: Whether to use the value from the Snap_Edge_Property, or a

149.        --           value derived from Handle_Position

150.        --

151.        --  </properties>

153.        Child_Detached_Property  : constant Glib.Properties.Property_BooleanTo API docTo spec;

154.        Shadow_Property          : constant Gtk.Enums.Property_Gtk_Shadow_TypeTo API docTo spec;

155.        Shadow_Type_Property     : constant Gtk.Enums.Property_Gtk_Shadow_TypeTo API docTo spec;

156.        Handle_Position_Property : constant Gtk.Enums.Property_Gtk_Position_TypeTo API docTo spec;

157.        Snap_Edge_Property       : constant Gtk.Enums.Property_Gtk_Position_TypeTo API docTo spec;

158.        Snap_Edge_Set_Property   : constant Glib.Properties.Property_BooleanTo API docTo spec;

160.        -------------

161.        -- Signals --

162.        -------------

164.        --  <signals>

165.        --  The following new signals are defined for this widget:

166.        --

167.        --  - "child_attached"

168.        --    procedure Handler

169.        --      (Handle_Box : access Gtk_Handle_Box_Record'Class;

170.        --       Widget     : access Gtk_Widget_Record'Class);

171.        --    Emitted when the contents of the Handle_Box are reattached to the main

172.        --    window.

173.        --    Widget is the child widget of the Handle_Box. (this argument provides

174.        --    no extra information and is here only for backwards-compatibility)

175.        --

176.        --  - "child_detached"

177.        --    procedure Handler

178.        --      (Handle_Box : access Gtk_Handle_Box_Record'Class;

179.        --       Widget     : access Gtk_Widget_Record'Class);

180.        --    Emitted when the contents of the Handle_Box are detached from the main

181.        --    window. See "child-attached" for drtails on the parameters.

182.        --

183.        --  </signals>

185.        Signal_Child_Attached : constant Glib.Signal_NameTo API docTo spec := "child_attached";

186.        Signal_Child_Detached : constant Glib.Signal_NameTo API docTo spec := "child_detached";

188.     private

189.        type Gtk_Handle_Box_RecordTo API docTo spec is new Gtk.Bin.Gtk_Bin_RecordTo API docTo spec with null record;

191.        Child_Detached_PropertyTo API docTo spec  : constant Glib.Properties.Property_BooleanTo API docTo spec :=

192.          Glib.Properties.BuildTo API docTo specTo body ("child-detached");

193.        Shadow_PropertyTo API docTo spec          : constant Gtk.Enums.Property_Gtk_Shadow_TypeTo API docTo spec :=

194.          Gtk.Enums.BuildTo API docTo specTo body ("shadow-type");  --  Same as Shadow_Type !

195.        Shadow_Type_PropertyTo API docTo spec     : constant Gtk.Enums.Property_Gtk_Shadow_TypeTo API docTo spec :=

196.          Gtk.Enums.BuildTo API docTo specTo body ("shadow-type");

197.        Handle_Position_PropertyTo API docTo spec : constant Gtk.Enums.Property_Gtk_Position_TypeTo API docTo spec :=

198.          Gtk.Enums.BuildTo API docTo specTo body ("handle_position");

199.        Snap_Edge_PropertyTo API docTo spec       : constant Gtk.Enums.Property_Gtk_Position_TypeTo API docTo spec :=

200.          Gtk.Enums.BuildTo API docTo specTo body ("snap_edge");

201.        Snap_Edge_Set_PropertyTo API docTo spec   : constant Glib.Properties.Property_BooleanTo API docTo spec :=

202.          Glib.Properties.BuildTo API docTo specTo body ("snap-edge-set");

204.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_handle_box_get_type");

205.     end Gtk.Handle_BoxTo API docTo specTo body;