TABLE OF CONTENTS
- 1. Widgets/TkScale
- 1.1. TkScale/TkScale.Tk_Scale
- 1.2. TkScale/TkScale.Coords
- 1.3. TkScale/TkScale.Create_(function)
- 1.4. TkScale/TkScale.Create_(procedure)
- 1.5. TkScale/TkScale.Get_(at_selected_pixel)
- 1.6. TkScale/TkScale.Get_(current_value)
- 1.7. TkScale/TkScale.Get_Widget
- 1.8. TkScale/TkScale.Identify
- 1.9. TkScale/TkScale.Set
Widgets/TkScale [ Packages ]
[ Top ] [ Widgets ] [ Packages ]
FUNCTION
Provides code for manipulate Tk widget Scale
SOURCE
package Tcl.Tk.Ada.Widgets.Scale with SPARK_Mode is pragma Elaborate_Body;
TkScale/TkScale.Tk_Scale [ Types ]
FUNCTION
This is a non-abstract type derived directly from Tk_Widget. Each of the derived widgets redefines the Create subprogram in order to create the correct type of widget.
SOURCE
type Tk_Scale is new Tk_Widget with private;
TkScale/TkScale.Coords [ Subprograms ]
[ Top ] [ TkScale ] [ Subprograms ]
FUNCTION
Get the elements which the x and y coordinates of the point along the centerline of the trough that corresponds to Value
SOURCE
function Coords (ScaleWidget: in Tk_Scale; Value: in String := "") return String;
PARAMETERS
ScaleWidget - Tk_Scale which will be queried for coordinates Value - Value for query. Can be empty. Default value is empty
RESULT
A list whose elements are the x and y coordinates of the point along the centerline of the trough that corresponds to Value. If Value is omitted then the ScaleWidget's current value is used.
EXAMPLE
-- Get the element at the current value of My_Scale scale Element: constant String := Coords(My_Scale);
COMMANDS
ScaleWidget coords ?value?
HISTORY
8.6.4 - Added
TkScale/TkScale.Create_(function) [ Subprograms ]
[ Top ] [ TkScale ] [ Subprograms ]
FUNCTION
Creates a new Tk_Scale in the specified interpreter.
SOURCE
overriding function Create (pathName: in String; options: in String := ""; Interp: in Tcl_Interp := Null_Interp) return Tk_Scale with Global => null;
PARAMETERS
pathName - Tk path (starts with dot) for the widget options - Options which will be passed to the widget. Default value is empty Interp - Tcl interpreter to which the widget will be created. If null, the widget will be created in the "contextual" interpreter. Default value is null.
RESULT
Newly created Tk_Scale
EXAMPLE
-- Create a new scale with pathname .myscale and orientation horizontal My_Scale: constant Tk_Scale := Create(".myscale", "-orient horizontal");
SEE ALSO
TkScale.Create_(procedure)
COMMANDS
scale pathName ?options?
HISTORY
8.6.1 - Added
TkScale/TkScale.Create_(procedure) [ Subprograms ]
[ Top ] [ TkScale ] [ Subprograms ]
FUNCTION
Creates a new Tk_Scale in the specified interpreter.
SOURCE
overriding procedure Create (Widgt: out Tk_Scale; pathName: in String; options: in String := ""; Interp: in Tcl_Interp := Null_Interp) with Global => null;
PARAMETERS
Widgt - Tk_Scale which will be created pathName - Tk path (starts with dot) for the widget options - Options which will be passed to the widget. Default value is empty Interp - Tcl interpreter to which the widget will be created. If null, the widget will be created in the "contextual" interpreter. Default value is null.
OUTPUT
Newly created Tk_Scale as parameter Widgt
EXAMPLE
-- Create scale My_Scale with pathname .myscale and label my scale on the current Tcl interpreter declare My_Scale: Tk_Scale; begin Create(My_Scale, ".myscale", "-label {my scale}"); end;
SEE ALSO
TkScale.Create_(function)
COMMANDS
scale pathName ?options?
HISTORY
8.6.1 - Added
TkScale/TkScale.Get_(at_selected_pixel) [ Subprograms ]
[ Top ] [ TkScale ] [ Subprograms ]
FUNCTION
Get value of the Tk_Scale at selected widget
SOURCE
function Get(ScaleWidget: in Tk_Scale; X, Y: in String) return String with Pre'Class => X /= "" and Y /= "";
PARAMETERS
ScaleWidget - Tk_Scale which will be queried for value X - X coordinate from which value will be taken Y - Y coordinate from which value will be taken
RESULT
Value of the ScaleWidget at the selected pixel
EXAMPLE
-- Get the value at pixel (45, 21) in My_Scale scale Value := constant String := Get(My_Scale, "45", "21");
SEE ALSO
TkScale.Get_(current_value)
COMMANDS
ScaleWidget get x y
HISTORY
8.6.4 - Added
TkScale/TkScale.Get_(current_value) [ Subprograms ]
[ Top ] [ TkScale ] [ Subprograms ]
FUNCTION
Get current value of the Tk_Scale
SOURCE
function Get(ScaleWidget: in Tk_Scale) return String;
PARAMETERS
ScaleWidget - Tk_Scale which will be queried for value
RESULT
Current value of the ScaleWidget
EXAMPLE
-- Get the current value of the My_Scale scale Value: constant String := Get(My_Scale);
SEE ALSO
TkScale.Get_(at_selected_pixel)
COMMANDS
ScaleWidget get
HISTORY
8.6.4 - Added
TkScale/TkScale.Get_Widget [ Subprograms ]
[ Top ] [ TkScale ] [ Subprograms ]
FUNCTION
Get the existing Tk_Scale widget
SOURCE
overriding function Get_Widget (pathName: in String; Interp: in Tcl_Interp := Get_Context) return Tk_Scale with Global => null;
PARAMETERS
pathName - Tk path (starts with dot) for the widget Interp - Tcl interpreter on which the widget exists. Can be empty. Default value is current Tcl interpreter
RESULT
Existing Tk_Scale widget
EXAMPLE
-- Get scale widget with name .myscale on the current Tcl interpreter My_Scale: constant Tk_Scale := Get_Widget(".myscale");
HISTORY
8.6.9 - Added
TkScale/TkScale.Identify [ Subprograms ]
[ Top ] [ TkScale ] [ Subprograms ]
FUNCTION
Get which part of the Tk_Scale lies under the specified coordinates
SOURCE
function Identify (ScaleWidget: in Tk_Scale; X, Y: in String) return String with Pre'Class => X /= "" and Y /= "";
PARAMETERS
ScaleWidget - Tk_Scale which will be queried X - X coordinate of the pixel which will be queried Y - Y coordinate of the pixel which will be queried
RESULT
"slider" if pixel is at slider, "through1" if pixel is above or to the left from slider, "through2" if pixel is below or th the right from slider or "{}" if pixel is not in ScaleWidget
EXAMPLE
-- Get the name of the element at pixel (56, 32) in My_Scale scale Element_Name: constant String := Identify(My_Scale, "56", "32");
COMMANDS
ScaleWidget identify x y
HISTORY
8.6.4 - Added
TkScale/TkScale.Set [ Subprograms ]
[ Top ] [ TkScale ] [ Subprograms ]
FUNCTION
Set the selected Tk_Scale to a new value
SOURCE
procedure Set(ScaleWidget: in Tk_Scale; Value: in String) with Pre'Class => Value /= "";
PARAMETERS
ScaleWidget - Tk_Scale which value will be set Value - A new value for a ScaleWidget
EXAMPLE
-- Set the value of the My_Scale scale to 20 Set(My_Scale, "20");
COMMANDS
ScaleWidget set value
HISTORY
8.6.4 - Added