## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

1.     -----------------------------------------------------------------------

2.     --               GtkAda - Ada95 binding for Gtk+/Gnome               --

3.     --                                                                   --

4.     --                Copyright (C) 2006-2010 AdaCore                    --

5.     --                                                                   --

6.     -- This library is free software; you can redistribute it and/or     --

7.     -- modify it under the terms of the GNU General Public               --

8.     -- License as published by the Free Software Foundation; either      --

9.     -- version 2 of the License, or (at your option) any later version.  --

10.     --                                                                   --

11.     -- This library is distributed in the hope that it will be useful,   --

12.     -- but WITHOUT ANY WARRANTY; without even the implied warranty of    --

13.     -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU --

14.     -- General Public License for more details.                          --

15.     --                                                                   --

16.     -- You should have received a copy of the GNU General Public         --

17.     -- License along with this library; if not, write to the             --

18.     -- Free Software Foundation, Inc., 59 Temple Place - Suite 330,      --

19.     -- Boston, MA 02111-1307, USA.                                       --

20.     --                                                                   --

21.     -- As a special exception, if other files instantiate generics from  --

22.     -- this unit, or you link this unit with other files to produce an   --

23.     -- executable, this  unit  does not  by itself cause  the resulting  --

24.     -- executable to be covered by the GNU General Public License. This  --

25.     -- exception does not however invalidate any other reasons why the   --

26.     -- executable file  might be covered by the  GNU Public License.     --

27.     -----------------------------------------------------------------------

29.     --  <description>

30.     --  This package defines the base class for all items that can be added into

31.     --  a toolbar (see gtk-toolbar.ads).

32.     --  See also Gtk.Tool_Button (gtk-tool_button.ads).

33.     --  See also Gtk.Separator_Tool_Item (gtk-separator_tool_item).

34.     --  </description>

35.     --  <c_version>2.16.6</c_version>

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

38.     with Glib.PropertiesTo API docTo specTo body;

39.     with Gtk.BinTo API docTo specTo body;

40.     with Gtk.EnumsTo API docTo specTo body;

41.     with Gtk.Menu_ItemTo API docTo specTo body;

42.     with Gtk.TooltipsTo API docTo specTo body;

44.     package Gtk.Tool_ItemTo API docTo specTo body is

46.        type Gtk_Tool_Item_Record is new Gtk.Bin.Gtk_Bin_RecordTo API docTo spec with null record;

47.        type Gtk_Tool_Item is access all Gtk_Tool_Item_RecordTo API docTo spec'Class;

49.        --------------------

50.        -- Creating items --

51.        --------------------

53.        procedure Gtk_NewTo API docTo body    (Item : out Gtk_Tool_ItemTo API docTo spec);

54.        procedure InitializeTo API docTo body (Item : access Gtk_Tool_Item_RecordTo API docTo spec'Class);

55.        --  Create a new tool item, which contains a single child.

57.        function Get_TypeTo API docTo body return GTypeTo API docTo spec;

58.        --  Return the internal value associated with a Gtk_Button.

60.        procedure Set_ExpandTo API docTo body

61.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec;

62.           Expand    : Boolean);

63.        function Get_ExpandTo API docTo body

64.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec)

65.           return Boolean;

66.        --   Sets whether Tool_Item is allocated extra space when there is more room

67.        --   on the toolbar than needed for the items. The effect is that the item

68.        --   gets bigger when the toolbar gets bigger.

70.        procedure Set_HomogeneousTo API docTo body

71.          (Tool_Item   : access Gtk_Tool_Item_RecordTo API docTo spec;

72.           Homogeneous : Boolean);

73.        function Get_HomogeneousTo API docTo body

74.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec)

75.           return Boolean;

76.        --  Sets whether Tool_Item is to be allocated the same size as other

77.        --  homogeneous items. The effect is that all homogeneous items will have

78.        --  the same width as the widest of the items.

80.        function Get_Icon_SizeTo API docTo body

81.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec)

82.           return Gtk.Enums.Gtk_Icon_SizeTo API docTo spec;

83.        --  Returns the icon size used for Tool_Item. Custom subclasses of

84.        --  Gtk_Tool_Item_Record should call this function to find out what size

85.        --  icons they should use. This settings depends on the toolbar that

86.        --  contains the item

88.        procedure Set_Is_ImportantTo API docTo body

89.          (Tool_Item    : access Gtk_Tool_Item_RecordTo API docTo spec;

90.           Is_Important : Boolean);

91.        function Get_Is_ImportantTo API docTo body

92.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec)

93.           return Boolean;

94.        --  Sets whether Tool_Item should be considered important. The

95.        --  Gtk_Tool_Button class uses this property to determine whether to show or

96.        --  hide its label when the toolbar style is Toolbar_Both_Horiz. The result

97.        --  is that only tool buttons with the "is_important" property set have

98.        --  labels, an effect known as "priority text".

100.        function Get_OrientationTo API docTo body

101.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec)

102.           return Gtk.Enums.Gtk_OrientationTo API docTo spec;

103.        --  Returns the orientation used for Tool_Item.

105.        procedure Set_Proxy_Menu_ItemTo API docTo body

106.          (Tool_Item    : access Gtk_Tool_Item_RecordTo API docTo spec;

107.           Menu_Item_Id : String;

108.           Menu_Item    : Gtk.Menu_Item.Gtk_Menu_ItemTo API docTo spec);

109.        function Get_Proxy_Menu_ItemTo API docTo body

110.          (Tool_Item    : access Gtk_Tool_Item_RecordTo API docTo spec;

111.           Menu_Item_Id : String)

112.           return Gtk.Menu_Item.Gtk_Menu_ItemTo API docTo spec;

113.        --  Sets the menu item used in the toolbar overflow menu. Menu_Item_Id is

114.        --  used to identify the caller of this function and should also be used

115.        --  with Get_Proxy_Menu_Item.

116.        --  Custom subclasses of Gtk_Tool_Item_Record should use this function to

117.        --  update their menu item when the tool item changes.

118.        --  See also Gtk.Toolbar.Set_Show_Arrow.

120.        function Retrieve_Proxy_Menu_ItemTo API docTo body

121.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec)

122.           return Gtk.Menu_Item.Gtk_Menu_ItemTo API docTo spec;

123.        --  Returns the menu item that was last set by Set_Proxy_Menu_Item, ie the

124.        --  menu item that will appear in the overflow menu. This might be

125.        --  different from the one set through Set_Proxy_Menu_Item, if someone else

126.        --  has overriden the menu afterward.

128.        procedure Rebuild_MenuTo API docTo body (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec);

129.        --  Calling this function signals to the toolbar that the

130.        --  overflow menu item for Tool_Item has changed. If the

131.        --  overflow menu is visible when this function it called,

132.        --  the menu will be rebuilt.

134.        procedure Set_TooltipTo API docTo body

135.          (Tool_Item   : access Gtk_Tool_Item_RecordTo API docTo spec;

136.           Tooltips    : access Gtk.Tooltips.Gtk_Tooltips_RecordTo API docTo specTo body'Class;

137.           Tip_Text    : String;

138.           Tip_Private : String := "");

139.        --  Sets the tooltips object to be used for Tool item, the text to be

140.        --  displayed as tooltip on the item and the private text to be used

142.        procedure Set_Tooltip_MarkupTo API docTo body

143.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec;

144.           Markup    : UTF8_StringTo API docTo spec);

145.        --  Sets the markup text to be displayed as tooltip on the item.

146.        --  See Gtk.Widget.Set_Tooltip_Markup.

148.        procedure Set_Tooltip_TextTo API docTo body

149.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec;

150.           Text      : UTF8_StringTo API docTo spec);

151.        --  Sets the text to be displayed as tooltip on the item.

152.        --  See Gtk.Widget.Set_Tooltip_Text.

154.        procedure Set_Visible_VerticalTo API docTo body

155.          (Toolitem         : access Gtk_Tool_Item_RecordTo API docTo spec;

156.           Visible_Vertical : Boolean);

157.        function Get_Visible_VerticalTo API docTo body

158.          (Toolitem : access Gtk_Tool_Item_RecordTo API docTo spec)

159.           return Boolean;

160.        --  Sets whether Toolitem is visible when the toolbar is docked

161.        --  vertically. Some tool items, such as text entries, are too wide to be

162.        --  useful on a vertically docked toolbar. If visible_vertical is False

163.        --  Toolitem will not appear on toolbars that are docked vertically.

165.        procedure Set_Visible_HorizontalTo API docTo body

166.          (Toolitem           : access Gtk_Tool_Item_RecordTo API docTo spec;

167.           Visible_Horizontal : Boolean);

168.        function Get_Visible_HorizontalTo API docTo body

169.          (Toolitem : access Gtk_Tool_Item_RecordTo API docTo spec)

170.           return Boolean;

171.        --  Same as Set_Visible_Vertical, but for a horizontal orientation

173.        procedure Set_Use_Drag_WindowTo API docTo body

174.          (Toolitem        : access Gtk_Tool_Item_RecordTo API docTo spec;

175.           Use_Drag_Window : Boolean);

176.        function Get_Use_Drag_WindowTo API docTo body

177.          (Toolitem : access Gtk_Tool_Item_RecordTo API docTo spec)

178.           return Boolean;

179.        --  Sets whether Toolitem has a drag window. When True the

180.        --  toolitem can be used as a drag source through gtk_drag_source_set().

181.        --  When Toolitem has a drag window it will intercept all events,

182.        --  even those that would otherwise be sent to a child of Toolitem.

184.        function Get_Relief_StyleTo API docTo body

185.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec)

186.           return Gtk.Enums.Gtk_Relief_StyleTo API docTo spec;

187.        --  Get the relief style of the item

189.        function Get_Toolbar_StyleTo API docTo body

190.          (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec)

191.           return Gtk.Enums.Gtk_Toolbar_StyleTo API docTo spec;

192.        --  Get the style of the toolbar that contains the item

194.        procedure Toolbar_ReconfiguredTo API docTo body (Tool_Item : access Gtk_Tool_Item_RecordTo API docTo spec);

195.        --  Emits the signal #GtkToolItem::toolbar_reconfigured on Tool_Item.

196.        --  Gtk_Toolbar and other Gtk_Tool_Shell implementations use this function

197.        --  to notify children when some aspect of their configuration changes.

199.        ----------------

200.        -- Properties --

201.        ----------------

203.        --  <properties>

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

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

206.        --

207.        --  - Name: Visible_Horizontal_Property

208.        --    Type: Boolean

209.        --    See : Set_Visible_Horizontal

210.        --

211.        --  - Name: Visible_Vertical_Property

212.        --    Type: Boolean

213.        --    See : Set_Visible_Vertical

214.        --

215.        --  - Name: Is_Important_Property

216.        --    Type: Boolean

217.        --    See : Set_Is_Important

218.        --

219.        --  </properties>

221.        Visible_Horizontal_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

222.        Visible_Vertical_Property   : constant Glib.Properties.Property_BooleanTo API docTo spec;

223.        Is_Important_Property       : constant Glib.Properties.Property_BooleanTo API docTo spec;

225.        -------------

226.        -- Signals --

227.        -------------

229.        --  <signals>

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

231.        --

232.        --  - "create_menu_proxy"

233.        --    function Handler

234.        --       (Item : access Gtk_Tool_Item_Record'Class) return Boolean;

235.        --    Emitted when the toolbar needs information from the item about whether

236.        --    the item should appear in the toolbar overflow menu. In response, the

237.        --    item should either:

238.        --       - call Set_Proxy_Menu_Item with a null parameter, and return True,

239.        --         to indicate that the item should not appear

240.        --       - call Set_Proxy_Menu_Item with a new menu item, and return True

241.        --       - return False to indicate that the signal wasn't handled. The item

242.        --         will not appear in the overflow menu unless a later handler

243.        --         installs a menu item

244.        --    The toolbar may cache the result of this signal. See Rebuild_Menu to

245.        --    invalidate the cache.

246.        --

247.        --  - "toolbar_reconfigured"

248.        --    procedure Handler (Item : access Gtk_Tool_Item_Record'Class);

249.        --    Emitted when some property of the toolbar that Item belongs to has

250.        --    changed.

251.        --

252.        --  - "set_tooltip"

253.        --    function Handler

254.        --       (Item        : access Gtk_Tool_Item_Record'Class;

255.        --        Tooltips    : access Gtk_Tooltips_Record'Class;

256.        --        Tip         : String;

257.        --        Tip_Private : String) return Boolean;

258.        --    Emitted when the item's tooltip has changed through Set_Tooltip.

259.        --    Should return True if the signal was handled.

260.        --

261.        --  </signals>

263.        Signal_Create_Menu_Proxy    : constant Glib.Signal_NameTo API docTo spec :=

264.                                        "create_menu_proxy";

265.        Signal_Toolbar_Reconfigured : constant Glib.Signal_NameTo API docTo spec :=

266.                                        "toolbar_reconfigured";

267.        Signal_Set_Tooltip          : constant Glib.Signal_NameTo API docTo spec :=

268.                                        "set_tooltip";

270.     private

272.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_tool_item_get_type");

274.        Visible_Horizontal_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

275.          Glib.Properties.BuildTo API docTo specTo body ("visible-horizontal");

276.        Visible_Vertical_PropertyTo API docTo spec   : constant Glib.Properties.Property_BooleanTo API docTo spec :=

277.          Glib.Properties.BuildTo API docTo specTo body ("visible-vertical");

278.        Is_Important_PropertyTo API docTo spec       : constant Glib.Properties.Property_BooleanTo API docTo spec :=

279.          Glib.Properties.BuildTo API docTo specTo body ("is-important");

280.     end Gtk.Tool_ItemTo API docTo specTo body;