## 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-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.     -- 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.     --  A Gtk_Toggle_Button is like a regular button, but can be in one of two

32.     --  states, "active" or "inactive". Its visual aspect is modified when the

33.     --  state is changed.

34.     --

35.     --  You should consider using a Gtk_Check_Button instead, since it looks nicer

36.     --  and provides more visual clues that the button can be toggled.

37.     --

38.     --  </description>

39.     --  <screenshot>gtk-toggle_button</screenshot>

40.     --  <group>Buttons and Toggles</group>

41.     --  <testgtk>create_toggle_buttons.adb</testgtk>

43.     pragma Warnings (Off, "*is already use-visible*");

44.     with GlibTo API docTo specTo body;            use GlibTo API docTo specTo body;

45.     with Glib.PropertiesTo API docTo specTo body; use Glib.PropertiesTo API docTo specTo body;

46.     with Glib.TypesTo API docTo specTo body;      use Glib.TypesTo API docTo specTo body;

47.     with Gtk.ActionTo API docTo specTo body;      use Gtk.ActionTo API docTo specTo body;

48.     with Gtk.ActivatableTo API docTo specTo body; use Gtk.ActivatableTo API docTo specTo body;

49.     with Gtk.BuildableTo API docTo specTo body;   use Gtk.BuildableTo API docTo specTo body;

50.     with Gtk.ButtonTo API docTo specTo body;      use Gtk.ButtonTo API docTo specTo body;

51.     with Gtk.WidgetTo API docTo specTo body;      use Gtk.WidgetTo API docTo specTo body;

53.     package Gtk.Toggle_ButtonTo API docTo specTo body is

55.        type Gtk_Toggle_Button_Record is new Gtk_Button_RecordTo API docTo spec with null record;

56.        type Gtk_Toggle_Button is access all Gtk_Toggle_Button_RecordTo API docTo spec'Class;

58.        ------------------

59.        -- Constructors --

60.        ------------------

62.        procedure Gtk_NewTo API docTo body

63.           (Toggle_Button : out Gtk_Toggle_ButtonTo API docTo spec;

64.            Label         : UTF8_StringTo API docTo spec := "");

65.        procedure InitializeTo API docTo body

66.           (Toggle_Button : access Gtk_Toggle_Button_RecordTo API docTo spec'Class;

67.            Label         : UTF8_StringTo API docTo spec := "");

68.        --  Initialize a button. If Label is "", then no label is created inside

69.        --  the button and you will have to provide your own child through a call to

70.        --  Gtk.Container.Add. This is the recommended way to put a pixmap inside a

71.        --  toggle button.

73.        procedure Gtk_New_With_MnemonicTo API docTo body

74.           (Toggle_Button : out Gtk_Toggle_ButtonTo API docTo spec;

75.            Label         : UTF8_StringTo API docTo spec);

76.        procedure Initialize_With_MnemonicTo API docTo body

77.           (Toggle_Button : access Gtk_Toggle_Button_RecordTo API docTo spec'Class;

78.            Label         : UTF8_StringTo API docTo spec);

79.        --  Creates a new Gtk.Toggle_Button.Gtk_Toggle_Button containing a label.

80.        --  The label will be created using Gtk.Label.Gtk_New_With_Mnemonic, so

81.        --  underscores in Label indicate the mnemonic for the button.

82.        --  "label": the text of the button, with an underscore in front of the

83.        --  mnemonic character

85.        function Get_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

86.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_toggle_button_get_type");

88.        -------------

89.        -- Methods --

90.        -------------

92.        function Get_ActiveTo API docTo body

93.           (Toggle_Button : access Gtk_Toggle_Button_RecordTo API docTo spec) return Boolean;

94.        procedure Set_ActiveTo API docTo body

95.           (Toggle_Button : access Gtk_Toggle_Button_RecordTo API docTo spec;

96.            Is_Active     : Boolean);

97.        --  Change the state of the button. When Is_Active is True, the button is

98.        --  drawn as a pressed button

100.        function Get_InconsistentTo API docTo body

101.           (Toggle_Button : access Gtk_Toggle_Button_RecordTo API docTo spec) return Boolean;

102.        procedure Set_InconsistentTo API docTo body

103.           (Toggle_Button : access Gtk_Toggle_Button_RecordTo API docTo spec;

104.            Setting       : Boolean := True);

105.        --  If the user has selected a range of elements (such as some text or

106.        --  spreadsheet cells) that are affected by a toggle button, and the current

107.        --  values in that range are inconsistent, you may want to display the

108.        --  toggle in an "in between" state. This function turns on "in between"

109.        --  display. Normally you would turn off the inconsistent state again if the

110.        --  user toggles the toggle button. This has to be done manually,

111.        --  Gtk.Toggle_Button.Set_Inconsistent only affects visual appearance, it

112.        --  doesn't affect the semantics of the button.

113.        --  "setting": True if state is inconsistent

115.        function Get_ModeTo API docTo body

116.           (Toggle_Button : access Gtk_Toggle_Button_RecordTo API docTo spec) return Boolean;

117.        procedure Set_ModeTo API docTo body

118.           (Toggle_Button  : access Gtk_Toggle_Button_RecordTo API docTo spec;

119.            Draw_Indicator : Boolean);

120.        --  Sets whether the button is displayed as a separate indicator and label.

121.        --  You can call this function on a checkbutton or a radiobutton with This

122.        --  function only affects instances of classes like

123.        --  Gtk.Check_Button.Gtk_Check_Button and Gtk.Radio_Button.Gtk_Radio_Button

124.        --  that derive from Gtk.Toggle_Button.Gtk_Toggle_Button, not instances of

125.        --  Gtk.Toggle_Button.Gtk_Toggle_Button itself.

126.        --  "draw_indicator": if True, draw the button as a separate indicator and

127.        --  label; if False, draw the button like a normal button

129.        procedure ToggledTo API docTo body (Toggle_Button : access Gtk_Toggle_Button_RecordTo API docTo spec);

131.        ---------------------

132.        -- Interfaces_Impl --

133.        ---------------------

135.        procedure Do_Set_Related_ActionTo API docTo body

136.           (Self   : access Gtk_Toggle_Button_RecordTo API docTo spec;

137.            Action : access Gtk.Action.Gtk_Action_RecordTo API docTo specTo body'Class);

139.        function Get_Related_ActionTo API docTo body

140.           (Self : access Gtk_Toggle_Button_RecordTo API docTo spec) return Gtk.Action.Gtk_ActionTo API docTo spec;

141.        procedure Set_Related_ActionTo API docTo body

142.           (Self   : access Gtk_Toggle_Button_RecordTo API docTo spec;

143.            Action : access Gtk.Action.Gtk_Action_RecordTo API docTo specTo body'Class);

145.        function Get_Use_Action_AppearanceTo API docTo body

146.           (Self : access Gtk_Toggle_Button_RecordTo API docTo spec) return Boolean;

147.        procedure Set_Use_Action_AppearanceTo API docTo body

148.           (Self           : access Gtk_Toggle_Button_RecordTo API docTo spec;

149.            Use_Appearance : Boolean);

151.        procedure Sync_Action_PropertiesTo API docTo body

152.           (Self   : access Gtk_Toggle_Button_RecordTo API docTo spec;

153.            Action : access Gtk.Action.Gtk_Action_RecordTo API docTo specTo body'Class);

155.        ----------------

156.        -- Interfaces --

157.        ----------------

158.        --  This class implements several interfaces. See Glib.Types

159.        --

160.        --  - "Activatable"

161.        --

162.        --  - "Buildable"

164.        package Implements_Activatable is new Glib.Types.ImplementsTo API docTo specTo body

165.          (Gtk.Activatable.Gtk_ActivatableTo API docTo spec, Gtk_Toggle_Button_RecordTo API docTo spec, Gtk_Toggle_ButtonTo API docTo spec);

166.        function "+"

167.          (Widget : access Gtk_Toggle_Button_RecordTo API docTo spec'Class)

168.        return Gtk.Activatable.Gtk_ActivatableTo API docTo spec

169.        renames Implements_Activatable.To_InterfaceTo API docTo specTo body;

170.        function "-"

171.          (Interf : Gtk.Activatable.Gtk_ActivatableTo API docTo spec)

172.        return Gtk_Toggle_ButtonTo API docTo spec

173.        renames Implements_Activatable.To_ObjectTo API docTo specTo body;

175.        package Implements_Buildable is new Glib.Types.ImplementsTo API docTo specTo body

176.          (Gtk.Buildable.Gtk_BuildableTo API docTo spec, Gtk_Toggle_Button_RecordTo API docTo spec, Gtk_Toggle_ButtonTo API docTo spec);

177.        function "+"

178.          (Widget : access Gtk_Toggle_Button_RecordTo API docTo spec'Class)

179.        return Gtk.Buildable.Gtk_BuildableTo API docTo spec

180.        renames Implements_Buildable.To_InterfaceTo API docTo specTo body;

181.        function "-"

182.          (Interf : Gtk.Buildable.Gtk_BuildableTo API docTo spec)

183.        return Gtk_Toggle_ButtonTo API docTo spec

184.        renames Implements_Buildable.To_ObjectTo API docTo specTo body;

186.        ----------------

187.        -- Properties --

188.        ----------------

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

190.        --  Glib.Properties for more information on properties)

191.        --

192.        --  Name: Active_Property

193.        --  Type: Boolean

194.        --  Flags: read-write

195.        --

196.        --  Name: Draw_Indicator_Property

197.        --  Type: Boolean

198.        --  Flags: read-write

199.        --

200.        --  Name: Inconsistent_Property

201.        --  Type: Boolean

202.        --  Flags: read-write

204.        Active_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

205.        Draw_Indicator_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

206.        Inconsistent_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

208.        -------------

209.        -- Signals --

210.        -------------

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

212.        --

213.        --  "toggled"

214.        --     procedure Handler (Self : access Gtk_Toggle_Button_Record'Class);

216.        Signal_Toggled : constant Glib.Signal_NameTo API docTo spec := "toggled";

218.     private

219.        Active_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

220.          Glib.Properties.BuildTo API docTo specTo body ("active");

221.        Draw_Indicator_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

222.          Glib.Properties.BuildTo API docTo specTo body ("draw-indicator");

223.        Inconsistent_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

224.          Glib.Properties.BuildTo API docTo specTo body ("inconsistent");

225.     end Gtk.Toggle_ButtonTo API docTo specTo body;