TABLE OF CONTENTS
- 1. Widgets/Scrollbar
- 1.1. Scrollbar/Scrollbar.Tk_Scrollbar
- 1.2. Scrollbar/Scrollbar.Activate_(function)
- 1.3. Scrollbar/Scrollbar.Activate_(procedure)
- 1.4. Scrollbar/Scrollbar.Create_(function)
- 1.5. Scrollbar/Scrollbar.Create_(procedure)
- 1.6. Scrollbar/Scrollbar.Fraction
- 1.7. Scrollbar/Scrollbar.Get
- 1.8. Scrollbar/Scrollbar.Get_Widget
- 1.9. Scrollbar/Scrollbar.Identify
- 1.10. Scrollbar/Scrollbar.Scrollbar_Delta
- 1.11. Scrollbar/Scrollbar.Set
Widgets/Scrollbar [ Packages ]
[ Top ] [ Widgets ] [ Packages ]
FUNCTION
Provides code for manipulate Tk widget Scrollbar
SOURCE
package Tcl.Tk.Ada.Widgets.Scrollbar with SPARK_Mode is pragma Elaborate_Body;
Scrollbar/Scrollbar.Tk_Scrollbar [ Types ]
[ Top ] [ Scrollbar ] [ 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_Scrollbar is new Tk_Widget with private;
Scrollbar/Scrollbar.Activate_(function) [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Get an active element of the selected Tk_Scrollbar
SOURCE
function Activate(ScrollbarWidget: in Tk_Scrollbar) return String;
PARAMETERS
ScrollbarWidget - Tk_Scrollbar in which an element will be activated
RESULT
Name of currently active element: "arrow1", "slider" or "arrow2" or {} if no element is currently active
EXAMPLE
-- Get the active element in the My_Scrollbar scrollbar Element: constant String := Activate(My_Scrollbar);
SEE ALSO
Scrollbar.Activate_(procedure)
COMMANDS
ScrollbarWidget activate
HISTORY
8.6.4 - Added
Scrollbar/Scrollbar.Activate_(procedure) [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Set the selected element as an active in the selected Tk_Scrollbar
SOURCE
procedure Activate (ScrollbarWidget: in Tk_Scrollbar; Element: in String) with Pre'Class => Element in "arrow1" | "slider" | "arrow2";
PARAMETERS
ScrollbarWidget - Tk_Scrollbar in which an element will be activated Element - The element to activate. Can be "arrow1", "slider" or "arrow2"
EXAMPLE
-- Activate "arrow1" in My_Scrollbar scrollbar Activate(My_Scrollbar, "arrow1");
SEE ALSO
Scrollbar.Activate_(function)
COMMANDS
ScrollbarWidget activate element
HISTORY
8.6.4 - Added
Scrollbar/Scrollbar.Create_(function) [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Creates a new Tk_Scrollbar in the specified interpreter.
SOURCE
overriding function Create (pathName: in String; options: in String := ""; Interp: in Tcl_Interp := Null_Interp) return Tk_Scrollbar 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_Scrollbar
EXAMPLE
-- Create a new scrollbar with pathname .myscroll and orientation horizontal My_Scrollbar: constant Tk_Scrollbar := Create(".myscroll", "-orient horizontal");
SEE ALSO
Scrollbar.Create_(procedure)
COMMANDS
scrollbar pathName ?options?
HISTORY
8.6.1 - Added
Scrollbar/Scrollbar.Create_(procedure) [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Creates a new Tk_Scrollbar in the specified interpreter.
SOURCE
overriding procedure Create (Widgt: out Tk_Scrollbar; pathName: in String; options: in String := ""; Interp: in Tcl_Interp := Null_Interp) with Global => null;
PARAMETERS
Widgt - Tk_Scrollbar 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_Scrollbar as parameter Widgt
EXAMPLE
-- Create scrollbar My_Scrollbar with pathname .myscroll and relief solid on the current Tcl interpreter declare My_Scrollbar: Tk_Scrollbar; begin Create(My_Scrollbar, ".myscroll", "-relief solid"); end;
SEE ALSO
Scrollbar.Create_(function)
COMMANDS
scrollbar pathName ?options?
HISTORY
8.6.1 - Added
Scrollbar/Scrollbar.Fraction [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Get the fraction of the selected Tk_Scrollbar at the selected pixel
SOURCE
function Fraction (ScrollbarWidget: in Tk_Scrollbar; X, Y: in String) return String with Pre'Class => X /= "" and Y /= "";
PARAMETERS
ScrollbarWidget - Tk_Scrollbar which will be queried for the fraction X - X coordinate of the pixel inside ScrollbarWidget Y - Y coordinate of the pixel inside ScrollbarWidget
RESULT
Value between 0 and 1 where 0 is top or left of the trough and 1 is bottom or right, middle is 0.5.
EXAMPLE
-- Get the fraction for My_Scrollbar at point (23, 56) Scroll_Fraction: constant String := Fraction(My_Scrollbar, "23", "56");
COMMANDS
ScrollbarWidget fraction x y
HISTORY
8.6.4 - Added
Scrollbar/Scrollbar.Get [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Get the Tk_Scrollbar setting for which part of associated widget is currently visible
SOURCE
function Get(ScrollbarWidget: in Tk_Scrollbar) return String;
PARAMETERS
ScrollbarWidget - Tk_Scrollbar which will be queried for setting
RESULT
Two values of real fraction between 0 and 1 for visible part of the associated widget.
EXAMPLE
-- Get the visibility setting for the scrollbar My_Scrollbar Visible: constant String := Get(My_Scrollbar);
SEE ALSO
Scrollbar.Set
COMMANDS
ScrollbarWidget get
HISTORY
8.6.4 - Added
Scrollbar/Scrollbar.Get_Widget [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Get the existing Tk_Scrollbar widget
SOURCE
overriding function Get_Widget (pathName: in String; Interp: in Tcl_Interp := Get_Context) return Tk_Scrollbar 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_Scrollbar widget
EXAMPLE
-- Get Scrollbar widget with name .myscroll on the current Tcl interpreter My_Scroll: constant Tk_Scrollbar := Get_Widget(".myscroll");
HISTORY
8.6.9 - Added
Scrollbar/Scrollbar.Identify [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Get the name of the Tk_Scrollbar element at the selected pixel
SOURCE
function Identify (ScrollbarWidget: in Tk_Scrollbar; X, Y: in String) return String with Pre'Class => X /= "" and Y /= "";
PARAMETERS
ScrollbarWidget - Tk_Scrollbar which will be queried for the element name X - X coordinate of the pixel to check Y - Y coordinate of the pixel to check
RESULT
Name of the ScrollbarWidget's element in which the selected pixel is. If the selected pixel is outside of the ScrollbarWidget, return {}
EXAMPLE
-- Get the name of the My_Scrollbar scrollbar element at point (56, 23) Element_Name: constant String := Identify(My_Scrollbar, "56", "23");
COMMANDS
ScrollbarWidget identify x y
HISTORY
8.6.4 - Added
Scrollbar/Scrollbar.Scrollbar_Delta [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Get the fraction change between current Tk_Scrollbar setting and the selected value
SOURCE
function Scrollbar_Delta (ScrollbarWidget: in Tk_Scrollbar; DeltaX, DeltaY: in String) return String with Pre'Class => DeltaX /= "" and DeltaY /= "";
PARAMETERS
ScrollbarWidget - Tk_Scrollbar which will be queried DeltaX - An value to check for horizontal scrollbar. Ignored when ScrollbarWidget is a vertical scrollbar. DeltaY - An value to check for vertical scrollbar. Ignored when ScrollbarWidget is a horizontal widget.
RESULT
A string with a real number indicating the fractional change in the scrollbar setting that corresponds to a given change in slider position.
EXAMPLE
-- Get the fraction for horizontal scrollbar My_Scrollbar for value 10 Delta: constant String := Scrollbar_Delta(My_Scrollbar, "10", "0");
COMMANDS
ScrollbarWidget delta deltaX deltaY
HISTORY
8.6.4 - Added
Scrollbar/Scrollbar.Set [ Subprograms ]
[ Top ] [ Scrollbar ] [ Subprograms ]
FUNCTION
Set the Tk_Scrollbar setting for which part of associated widget is currently visible
SOURCE
procedure Set(ScrollbarWidget: in Tk_Scrollbar; First, Last: in String) with Pre'Class => First /= "" and Last /= "";
PARAMETERS
ScrollbarWidget - Tk_Scrollbar which setting will be changed First - Start fraction of visible part of the associated widget Last - End fraction of visible part of the associated widget
EXAMPLE
-- Set visibility of the associated widget to My_Scrollbar scrollbar from 0 to 20% Set(My_Scrollbar, "0.0", "0.2");
SEE ALSO
Scrollbar.Get
COMMANDS
ScrollbarWidget set first last
HISTORY
8.6.4 - Added