## 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 scale is a horizontal or vertical widget that a user can slide to choose

32.     --  a value in a given range. This is a kind of cursor, similar to what one

33.     --  finds on audio systems to select the volume for instance.

34.     --

35.     --  </description>

36.     --  <screenshot>gtk-scale.png</screenshot>

37.     --  <group>Numeric/Text Data Entry</group>

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

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

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

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

43.     with Gtk.AdjustmentTo API docTo specTo body;  use Gtk.AdjustmentTo API docTo specTo body;

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

45.     with Gtk.EnumsTo API docTo specTo body;       use Gtk.EnumsTo API docTo specTo body;

46.     with Gtk.GRangeTo API docTo specTo body;      use Gtk.GRangeTo API docTo specTo body;

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

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

49.     with Pango.LayoutTo API docTo specTo body;    use Pango.LayoutTo API docTo specTo body;

51.     package Gtk.ScaleTo API docTo specTo body is

53.        type Gtk_Scale_Record is new Gtk_Range_RecordTo API docTo spec with null record;

54.        type Gtk_Scale is access all Gtk_Scale_RecordTo API docTo spec'Class;

56.        subtype Gtk_Hscale_Record is Gtk_Scale_RecordTo API docTo spec;

57.        subtype Gtk_Hscale is Gtk_ScaleTo API docTo spec;

59.        subtype Gtk_Vscale_Record is Gtk_Scale_RecordTo API docTo spec;

60.        subtype Gtk_Vscale is Gtk_ScaleTo API docTo spec;

62.        ------------------

63.        -- Constructors --

64.        ------------------

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

67.        pragma Import (C, Get_TypeTo API docTo spec, "gtk_scale_get_type");

69.        procedure Gtk_New_HscaleTo API docTo body

70.           (Scale      : out Gtk_HscaleTo API docTo spec;

71.            Adjustment : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec := null);

72.        procedure Initialize_HscaleTo API docTo body

73.           (Scale      : access Gtk_Hscale_RecordTo API docTo spec'Class;

74.            Adjustment : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec := null);

75.        procedure Gtk_New_HscaleTo API docTo body

76.           (Scale : out Gtk_HscaleTo API docTo spec;

77.            Min   : GdoubleTo API docTo spec;

78.            Max   : GdoubleTo API docTo spec;

79.            Step  : GdoubleTo API docTo spec);

80.        procedure Initialize_HscaleTo API docTo body

81.           (Scale : access Gtk_Hscale_RecordTo API docTo spec'Class;

82.            Min   : GdoubleTo API docTo spec;

83.            Max   : GdoubleTo API docTo spec;

84.            Step  : GdoubleTo API docTo spec);

85.        --  Creates a new horizontal scale widget that lets the user input a number

86.        --  between Min and Max (including Min and Max) with the increment Step.

87.        --  Step must be nonzero; it's the distance the slider moves when using the

88.        --  arrow keys to adjust the scale value. Note that the way in which the

89.        --  precision is derived works best if Step is a power of ten. If the

90.        --  resulting precision is not suitable for your needs, use

91.        --  Gtk.Scale.Set_Digits to correct it.

92.        --  "min": minimum value

93.        --  "max": maximum value

94.        --  "step": step increment (tick size) used with keyboard shortcuts

96.        function Hscale_Get_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

97.        pragma Import (C, Hscale_Get_TypeTo API docTo spec, "gtk_hscale_get_type");

99.        procedure Gtk_New_VscaleTo API docTo body

100.           (Scale      : out Gtk_VscaleTo API docTo spec;

101.            Adjustment : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec := null);

102.        procedure Initialize_VscaleTo API docTo body

103.           (Scale      : access Gtk_Vscale_RecordTo API docTo spec'Class;

104.            Adjustment : Gtk.Adjustment.Gtk_AdjustmentTo API docTo spec := null);

105.        procedure Gtk_New_VscaleTo API docTo body

106.           (Scale : out Gtk_VscaleTo API docTo spec;

107.            Min   : GdoubleTo API docTo spec;

108.            Max   : GdoubleTo API docTo spec;

109.            Step  : GdoubleTo API docTo spec);

110.        procedure Initialize_VscaleTo API docTo body

111.           (Scale : access Gtk_Vscale_RecordTo API docTo spec'Class;

112.            Min   : GdoubleTo API docTo spec;

113.            Max   : GdoubleTo API docTo spec;

114.            Step  : GdoubleTo API docTo spec);

115.        --  Creates a new vertical scale widget that lets the user input a number

116.        --  between Min and Max (including Min and Max) with the increment Step.

117.        --  Step must be nonzero; it's the distance the slider moves when using the

118.        --  arrow keys to adjust the scale value. Note that the way in which the

119.        --  precision is derived works best if Step is a power of ten. If the

120.        --  resulting precision is not suitable for your needs, use

121.        --  Gtk.Scale.Set_Digits to correct it.

122.        --  "min": minimum value

123.        --  "max": maximum value

124.        --  "step": step increment (tick size) used with keyboard shortcuts

126.        function Vscale_Get_TypeTo API docTo body return Glib.GTypeTo API docTo spec;

127.        pragma Import (C, Vscale_Get_TypeTo API docTo spec, "gtk_vscale_get_type");

129.        -------------

130.        -- Methods --

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

133.        procedure Add_MarkTo API docTo body

134.           (Scale    : access Gtk_Scale_RecordTo API docTo spec;

135.            Value    : GdoubleTo API docTo spec;

136.            PositionTo API docTo body : Gtk.Enums.Gtk_Position_TypeTo API docTo spec;

137.            Markup   : UTF8_StringTo API docTo spec);

138.        --  Adds a mark at Value. A mark is indicated visually by drawing a tick

139.        --  mark next to the scale, and GTK+ makes it easy for the user to position

140.        --  the scale exactly at the marks value. If Markup is not null, text is

141.        --  shown next to the tick mark. To remove marks from a scale, use

142.        --  Gtk.Scale.Clear_Marks.

143.        --  Since: gtk+ 2.16

144.        --  "value": the value at which the mark is placed, must be between the

145.        --  lower and upper limits of the scales' adjustment

146.        --  "position": where to draw the mark. For a horizontal scale, GTK_POS_TOP

147.        --  is drawn above the scale, anything else below. For a vertical scale,

148.        --  GTK_POS_LEFT is drawn to the left of the scale, anything else to the

149.        --  right.

150.        --  "markup": Text to be shown at the mark, using <link

151.        --  linkend="PangoMarkupFormat">Pango markup</link>, or null

153.        procedure Clear_MarksTo API docTo body (Scale : access Gtk_Scale_RecordTo API docTo spec);

154.        --  Removes any marks that have been added with Gtk.Scale.Add_Mark.

155.        --  Since: gtk+ 2.16

157.        function Get_DigitsTo API docTo body (Scale : access Gtk_Scale_RecordTo API docTo spec) return GintTo API docTo spec;

158.        procedure Set_DigitsTo API docTo body

159.           (Scale            : access Gtk_Scale_RecordTo API docTo spec;

160.            Number_Of_Digits : GintTo API docTo spec);

161.        --  Sets the number of decimal places that are displayed in the value. Also

162.        --  causes the value of the adjustment to be rounded off to this number of

163.        --  digits, so the retrieved value matches the value the user saw.

164.        --  "digits": the number of decimal places to display, e.g. use 1 to

165.        --  display 1.0, 2 to display 1.00, etc

167.        function Get_Draw_ValueTo API docTo body (Scale : access Gtk_Scale_RecordTo API docTo spec) return Boolean;

168.        procedure Set_Draw_ValueTo API docTo body

169.           (Scale      : access Gtk_Scale_RecordTo API docTo spec;

170.            Draw_Value : Boolean);

171.        --  Specifies whether the current value is displayed as a string next to

172.        --  the slider.

173.        --  "draw_value": True to draw the value

175.        function Get_LayoutTo API docTo body

176.           (Scale : access Gtk_Scale_RecordTo API docTo spec) return Pango.Layout.Pango_LayoutTo API docTo spec;

177.        --  Gets the Pango.Layout.Pango_Layout used to display the scale. The

178.        --  returned object is owned by the scale so does not need to be freed by

179.        --  the caller. or null if the Gtk.Scale.Gtk_Scale:draw-value property is

180.        --  False.

181.        --  Since: gtk+ 2.4

183.        procedure Get_Layout_OffsetsTo API docTo body

184.           (Scale : access Gtk_Scale_RecordTo API docTo spec;

185.            X     : out GintTo API docTo spec;

186.            Y     : out GintTo API docTo spec);

187.        --  Obtains the coordinates where the scale will draw the

188.        --  Pango.Layout.Pango_Layout representing the text in the scale. Remember

189.        --  when using the Pango.Layout.Pango_Layout function you need to convert to

190.        --  and from pixels using PANGO_PIXELS or PANGO_SCALE. If the

191.        --  Gtk.Scale.Gtk_Scale:draw-value property is False, the return values are

192.        --  undefined.

193.        --  Since: gtk+ 2.4

194.        --  "x": location to store X offset of layout, or null

195.        --  "y": location to store Y offset of layout, or null

197.        function Get_Value_PosTo API docTo body

198.           (Scale : access Gtk_Scale_RecordTo API docTo spec) return Gtk.Enums.Gtk_Position_TypeTo API docTo spec;

199.        procedure Set_Value_PosTo API docTo body

200.           (Scale : access Gtk_Scale_RecordTo API docTo spec;

201.            PosTo API docTo body   : Gtk.Enums.Gtk_Position_TypeTo API docTo spec);

202.        --  Sets the position in which the current value is displayed.

203.        --  "pos": the position in which the current value is displayed

205.        ---------------------

206.        -- Interfaces_Impl --

207.        ---------------------

209.        function Get_OrientationTo API docTo body

210.           (Self : access Gtk_Scale_RecordTo API docTo spec) return Gtk.Enums.Gtk_OrientationTo API docTo spec;

211.        procedure Set_OrientationTo API docTo body

212.           (Self        : access Gtk_Scale_RecordTo API docTo spec;

213.            OrientationTo API docTo body : Gtk.Enums.Gtk_OrientationTo API docTo spec);

215.        ----------------

216.        -- Interfaces --

217.        ----------------

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

219.        --

220.        --  - "Buildable"

221.        --

222.        --  - "Orientable"

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

225.          (Gtk.Buildable.Gtk_BuildableTo API docTo spec, Gtk_Scale_RecordTo API docTo spec, Gtk_ScaleTo API docTo spec);

226.        function "+"

227.          (Widget : access Gtk_Scale_RecordTo API docTo spec'Class)

228.        return Gtk.Buildable.Gtk_BuildableTo API docTo spec

229.        renames Implements_Buildable.To_InterfaceTo API docTo specTo body;

230.        function "-"

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

232.        return Gtk_ScaleTo API docTo spec

233.        renames Implements_Buildable.To_ObjectTo API docTo specTo body;

235.        package Implements_Orientable is new Glib.Types.ImplementsTo API docTo specTo body

236.          (Gtk.Orientable.Gtk_OrientableTo API docTo spec, Gtk_Scale_RecordTo API docTo spec, Gtk_ScaleTo API docTo spec);

237.        function "+"

238.          (Widget : access Gtk_Scale_RecordTo API docTo spec'Class)

239.        return Gtk.Orientable.Gtk_OrientableTo API docTo spec

240.        renames Implements_Orientable.To_InterfaceTo API docTo specTo body;

241.        function "-"

242.          (Interf : Gtk.Orientable.Gtk_OrientableTo API docTo spec)

243.        return Gtk_ScaleTo API docTo spec

244.        renames Implements_Orientable.To_ObjectTo API docTo specTo body;

246.        ----------------

247.        -- Properties --

248.        ----------------

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

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

251.        --

252.        --  Name: Number_Of_Digits_Property

253.        --  Type: Gint

254.        --  Flags: read-write

255.        --

256.        --  Name: Draw_Value_Property

257.        --  Type: Boolean

258.        --  Flags: read-write

259.        --

260.        --  Name: Value_Pos_Property

261.        --  Type: Gtk.Enums.Gtk_Position_Type

262.        --  Flags: read-write

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

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

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

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

268.        Number_Of_Digits_Property : constant Glib.Properties.Property_IntTo API docTo spec;

269.        Draw_Value_Property : constant Glib.Properties.Property_BooleanTo API docTo spec;

270.        Value_Pos_Property : constant Gtk.Enums.Property_Gtk_Position_TypeTo API docTo spec;

272.        -------------

273.        -- Signals --

274.        -------------

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

276.        --

277.        --  "format-value"

278.        --     function Handler

279.        --       (Self  : access Gtk_Scale_Record'Class;

280.        --        Value : Gdouble) return UTF8_String;

281.        --    --  "value": the value to format

282.        --  Signal which allows you to change how the scale value is displayed.

283.        --  Connect a signal handler which returns an allocated string representing

284.        --  Here's an example signal handler which displays a value 1.0 as with

285.        --  "--&gt;1.0&lt;--". |[ static gchar* format_value_callback (GtkScale

286.        --  *scale, gdouble value) { return g_strdup_printf

287.        --  ("--&gt;&percnt;0.*g&lt;--", gtk_scale_get_digits (scale), value); } ]|

288.        --  Returns allocated string representing Value

290.        Signal_Format_Value : constant Glib.Signal_NameTo API docTo spec := "format-value";

292.     private

293.        Number_Of_Digits_PropertyTo API docTo spec : constant Glib.Properties.Property_IntTo API docTo spec :=

294.          Glib.Properties.BuildTo API docTo specTo body ("digits");

295.        Draw_Value_PropertyTo API docTo spec : constant Glib.Properties.Property_BooleanTo API docTo spec :=

296.          Glib.Properties.BuildTo API docTo specTo body ("draw-value");

297.        Value_Pos_PropertyTo API docTo spec : constant Gtk.Enums.Property_Gtk_Position_TypeTo API docTo spec :=

298.          Gtk.Enums.BuildTo API docTo specTo body ("value-pos");

299.     end Gtk.ScaleTo API docTo specTo body;