A widget which allows to interactively
select which of its children is visible.
Synopsis
gnocl::notebook [-option value...]
Screenshot
Options
- -borderWidth integer or one of small, normal or big
-
Space in pixel between the children and the border of the widget.
-
-children list of page elements (default: "")
-
Each page element consist of two or three elements: a widget-ID of a
widget which is used as page content, a PERCENTSTRING which is used
as page label, and optional a PERCENTSTRING which is used as page
menu.
-
-onSwitchPage string (default: "")
-
Tcl command which is executed if the page is changed. Before
evaluation the following percent strings are substituted:
%w widget name %p number of new chosen page -
-tabPosition one of left, right, top, or bottom
-
The edge at which the tabs for switching pages are drawn.
-
-showTabs boolean (default: 1)
-
Whether to show the tabs for switching pages.
-
-scrollable boolean (default: 0)
-
Whether the tabs are scrollable.
-
-enablePopup boolean (default: 0)
-
Whether the popup menu for switching pages is enabled.
-
-homogeneous boolean (default: 0)
-
Whether all tabs have the same size.
-
-showBorder boolean (default: 1)
-
Whether the border is shown if showTabs is false.
-
-page integer (default: 0)
-
Number of current page.
-
-tooltip string
-
Message that appear next to this widget when the mouse pointer is
held over it for a short amount of time.
-
-onShowHelp string (default: "")
-
Tcl command which is executed in the global scope if the "show-help"
signal is received, which is normally the case if the user presses
F1 or Ctrl-F1. Before evaluation the following percent strings are substituted:
%w widget name %h help type: either
"whatsThis" or "tooltip" -
-name string
-
Name of the widget, can be used to set options in an rc file.
-
-visible boolean (default: 1)
-
Whether or not the item is visible.
-
-sensitive boolean (default: 1)
-
Whether or not the item is sensitive to user input.
Description
A notebook widget is a container widget whose children are pages
that can be switched between using tab labels along one edge.
Commands
- id delete
-
Deletes the widget and the associated tcl command.
-
id configure [-option
value...]
-
Configures the widget. Option may have any of the values accepted on
creation of the widget.
-
id addPage child label
?menu?
-
Adds a new page to the notebook. child is a widget-ID which is used
page content, label is a PERCENTSTRING which is used as page label,
and optional a PERCENTSTRING which is used as page menu. Returns the
number of the added page.
-
id currentPage ?num?
-
Switches to the page num if num is given. Returns the number of the
current page.
-
id nextPage ?count?
-
Switches to the next or the actual plus count page. Returns the
number of the current page.
-
id removePage num
-
Removes the page num.
Example
set notebook [gnocl::notebook]
$notebook addPage [gnocl::label \ -text "First Page"] "%__First"
$notebook addPage [gnocl::label \ -text "Second Page"] "%__Second"
gnocl::window \ -title "Notebook" \ -child $notebook
|