TABLE OF CONTENTS


Widgets/TtkNotebook [ Packages ]

[ Top ] [ Widgets ] [ Packages ]

FUNCTION

 Provides code for manipulate Tk widget Ttk::Notebook

SOURCE

package Tcl.Tk.Ada.Widgets.TtkNotebook with
   SPARK_Mode
is
   pragma Elaborate_Body;

TtkNotebook/TtkNotebook.Ttk_Notebook [ Types ]

[ Top ] [ TtkNotebook ] [ 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 Ttk_Notebook is new Tk_Widget with private;

TtkNotebook/TtkNotebook.Add [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Add a new window to the selected notebook

SOURCE

   procedure Add
     (Notebook: in Ttk_Notebook; WindowName: in String;
      Options: String := "") with
      Pre'Class => WindowName /= "";

PARAMETERS

 Notebook   - Ttk_Notebook to which window will be added
 WindowName - A name of widget to add to Ttk_Notebook
 Options    - Tk options for added window. Default value is empty

EXAMPLE

     -- Add a widget with pathname .myframe to the My_Notebook notebook with tab label my tab
     Add(My_Notebook, ".myframe", "-text {my tab}");

COMMANDS

 Notebook add windowname ?options?

HISTORY

 8.6.2 - Added

TtkNotebook/TtkNotebook.Create_(function) [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Creates a new Ttk_Notebook in the specified interpreter.

SOURCE

   overriding function Create
     (pathName: in String; options: in String := "";
      Interp: in Tcl_Interp := Null_Interp) return Ttk_Notebook 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 Ttk_Notebook

EXAMPLE

   -- Create a new notebook with pathname .mynotebook
   My_Notebook: constant Ttk_Notebook := Create(".mynotebook");

SEE ALSO

 TtkNotebook.Create_(procedure)

COMMANDS

 ttk::notebook pathName ?options?

HISTORY

 8.6.2 - Added

TtkNotebook/TtkNotebook.Create_(procedure) [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Creates a new Ttk_Notebook in the specified interpreter.

SOURCE

   overriding procedure Create
     (Widgt: out Ttk_Notebook; pathName: in String; options: in String := "";
      Interp: in Tcl_Interp := Null_Interp) with
      Global => null;

PARAMETERS

 Widgt    - Ttk_Notebook 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 Ttk_Notebook as parameter Widgt

EXAMPLE

     -- Create notebook My_Notebook with pathname .mynotebook on the current Tcl interpreter
     declare
        My_Notebook: Ttk_Notebook;
     begin
        Create(My_Notebook, ".mynotebook");
     end;

SEE ALSO

 TtkNotebook.Create_(function)

COMMANDS

 ttk::notebook pathName ?options?

HISTORY

 8.6.2 - Added

TtkNotebook/TtkNotebook.Forget [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Remove the selected tab and unmap the associated window

SOURCE

   procedure Forget(Notebook: in Ttk_Notebook; TabId: in String) with
      Pre'Class => TabId /= "";

PARAMETERS

 Notebook - Ttk_Notebook in which the tab will be removed
 TabId    - Id of the tab to remove

EXAMPLE

      -- Remove the currently selected tab in the My_Notebook notebook
      Forget(My_Notebook, "current");

COMMANDS

 Notebook forget tabid

HISTORY

 8.6.5 - Added

TtkNotebook/TtkNotebook.Get_Selected [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Get selected tab indentifier in the selected Ttk_Notebook

SOURCE

   function Get_Selected(Notebook: in Ttk_Notebook) return String;

PARAMETERS

 Notebook - Ttk_Notebook which will be queried for selected tab

RESULT

 Identifier of the selected tab in Notebook

EXAMPLE

      -- Get the identifier of the selected tab in My_Notebook notebook
      Tab_Index: constant String := Get_Selected(My_Notebook);

COMMANDS

 Notebook select

HISTORY

 8.6.2 - Added

TtkNotebook/TtkNotebook.Get_Widget [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Get the existing Ttk_Notebook widget

SOURCE

   overriding function Get_Widget
     (pathName: in String; Interp: in Tcl_Interp := Get_Context)
      return Ttk_Notebook 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 Ttk_Notebook widget

EXAMPLE

     -- Get notebook widget with name .mynotebook on the current Tcl interpreter
     My_Notebook: constant Ttk_Notebook := Get_Widget(".mynotebook");

HISTORY

 8.6.9 - Added

TtkNotebook/TtkNotebook.Hide [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Hide selected tab. Hidden tab can be restored with Add procedure

SOURCE

   procedure Hide(Notebook: in Ttk_Notebook; TabId: in String) with
      Pre'Class => TabId /= "";

PARAMETERS

 Notebook - Ttk_Notebook in which tab will be hidden
 TabId    - Id of the tab to hide

EXAMPLE

      -- Hide the second tab of My_Notebook notebook
      Hide(My_Notebook, "1");

COMMANDS

 Notebook hide tabid

HISTORY

 8.6.2 - Added

TtkNotebook/TtkNotebook.Identify_Element [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Get the name of the element at the specific location

SOURCE

   function Identify_Element
     (Notebook: in Ttk_Notebook; X, Y: in String) return String with
      Pre'Class => X /= "" and Y /= "";

PARAMETERS

 Notebook - Ttk_Notebook in which element will be queried
 X        - X coordinate of the location to query
 Y        - Y coordinate of the location to query

RESULT

 Name of the element at the specific location or {} if no component
 is present there

EXAMPLE

      -- Get the element at point (24, 82) in My_Notebook notebook
      Element_Name: constant String := Identify_Element(My_Notebook, "24", "82");

COMMANDS

 Notebook identify element x y

HISTORY

 8.6.5 - Added

TtkNotebook/TtkNotebook.Identify_Tab [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Get the index of the tab at the specific location

SOURCE

   function Identify_Tab
     (Notebook: in Ttk_Notebook; X, Y: in String) return String with
      Pre'Class => X /= "" and Y /= "";

PARAMETERS

 Notebook - Ttk_Notebook in which tabs will be queried
 X        - X coordinate of the location to query
 Y        - Y coordinate of the location to query

RESULT

 Index of the tab at the specific location or {} if no tab is present
 there

EXAMPLE

      -- Get the index of the tab at point (10, 56) in My_Notebook notebook
      Tab_Index: constant String := Identify_Tab(Notebook, "10", "56");

COMMANDS

 Notebook identify tab x y

HISTORY

 8.6.5 - Added

TtkNotebook/TtkNotebook.Index [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Get numeric index of the selected tab

SOURCE

   function Index
     (Notebook: in Ttk_Notebook; TabId: in String) return String with
      Pre'Class => TabId /= "";

PARAMETERS

 Notebook - Ttk_Notebook which will be queried
 TabId    - Index of the tab or "end"

RESULT

 Numeric index of the selected tab or amount of all tabs in Notebook,
 if TabId was "end"

EXAMPLE

      -- Get the amount of the tabs in My_Notebook notebook
      Amount: constant String := Index(My_Notebook, "end");

COMMANDS

 Notebook index tabid

HISTORY

 8.6.5 - Added

TtkNotebook/TtkNotebook.Insert [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Insert the selected window at the selected position in the selected
 Ttk_Notebook. If window is in the selected Ttk_Notebook, move it to
 the selected position

SOURCE

   procedure Insert
     (Notebook: in Ttk_Notebook; Pos: in String; SubWindow: in Tk_Widget'Class;
      Options: in String) with
      Pre'Class => Pos /= "" and Options /= "";

PARAMETERS

 Notebook  - Ttk_Notebook in which the selected SubWindow will be
             inserted or moved
 Pos       - Position to which insert or move the selected SubWindow
 SubWindow - Tk_Widget which will be inserted or moved
 Options   - Additional options for inserted or moved SubWindow

EXAMPLE

      -- Insert My_Frame to My_Notebook notebook at second position with label my tab
      Insert(My_Notebook, "1", My_Frame, "-text {my tab}");

COMMANDS

 Notebook insert pos subwindow ?options?

HISTORY

 8.6.6 - Added

TtkNotebook/TtkNotebook.Notebook_Select [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Set selected tab as a currently selected in the Ttk_Notebook

SOURCE

   procedure Notebook_Select(Notebook: in Ttk_Notebook; TabId: in String) with
      Pre'Class => TabId /= "";

PARAMETERS

 Notebook - Ttk_Notebook in which the tab will be selected
 TabId    - Id of the tab to select

EXAMPLE

      -- Set the first tab as the currently selected tab in My_Notebook notebook
      Notebook_Select(My_Notebook, "0");

COMMANDS

 Notebook select tabid

HISTORY

 8.6.2 - Added

TtkNotebook/TtkNotebook.Tab_(function) [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Get the value of the options of the selected tab in the selected
 Ttk_Notebook

SOURCE

   function Tab
     (Notebook: in Ttk_Notebook; TabId: in String; Option: in String := "")
      return String with
      Pre'Class => TabId /= "";

PARAMETERS

 Notebook - Ttk_Notebook in which tab will be queried for the options
 TabId    - Id of the tab which options will be queried
 Option   - Name of the option to get. Can be empty. Default value is
            empty

RESULT

 If Option is specified, return value of this option, otherwise return
 names and values of all options of the selected tab

EXAMPLE

      -- Get the title of the last tab in My_Notebook notebook
      Title: constant String := Tab(My_Notebook, "end", "-text");

SEE ALSO

 TtkNotebook.Tab_(procedure)

COMMANDS

 Notebook tab tabid

HISTORY

 8.6.6 - Added

TtkNotebook/TtkNotebook.Tab_(procedure) [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Set a new values for the selected options of the selected tab in the
 selected Ttk_Notebook

SOURCE

   procedure Tab(Notebook: in Ttk_Notebook; TabId, Options: in String) with
      Pre'Class => TabId /= "" and Options /= "";

PARAMETERS

 Notebook - Ttk_Notebook in which the tab will be set
 TabId    - Id of the tab which options will be set
 Options  - List of options with their new values

EXAMPLE

   -- Set the title of the second tab in My_Notebook notebook to my new tab
   Tab(My_Notebook, "1", "-text {my new tab}");

SEE ALSO

 TtkNotebook.Tab_(function)

COMMANDS

 Notebook tab tabid ?options?

HISTORY

 8.6.6 - Added

TtkNotebook/TtkNotebook.Tabs [ Subprograms ]

[ Top ] [ TtkNotebook ] [ Subprograms ]

FUNCTION

 Get the list of windows names managed by Ttk_Notebook

SOURCE

   function Tabs(Notebook: in Ttk_Notebook) return String;

PARAMETERS

 Notebook - Ttk_Notebook which will be queried for subwindows

RESULT

 A list of names of the windows managed by Notebook

EXAMPLE

      -- Get the names of the windows managed by My_Notebook notebook
      Names: constant String := Tabs(My_Notebook);

COMMANDS

 Notebook tabs

HISTORY

 8.6.6 - Added