notebook

Name

notebook -- A widget which allows to interactively select which of its children is visible.

Synopsis

notebook [-option value...]

Screenshot

Options

-borderWidth

type: integer or one of small, normal or big

Space in pixel between the children and the border of the widget.

-children

type: 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

type: string (default: "")

Tcl command which is executed if the page is changed. Before evaluation the following percent strings are substituted: TABLE %% | % %w | widget name. %p | number of new chosen page TABLE

-tabPosition

type: ONEOF left, right, top, or bottom

The edge at which the tabs for switching pages are drawn.

-showTabs

type: boolean (default: 1)

Whether to show the tabs for switching pages.

-scrollable

type: boolean (default: 0)

Whether the tabs are scrollable.

-enablePopup

type: boolean (default: 0)

Whether the popup menu for switching pages is enabled.

-homogeneous

type: boolean (default: 0)

Whether all tabs have the same size.

-showBorder

type: boolean (default: 1)

Whether the border is shown if showTabs is false.

-page

type: integer (default: 0)

Number of current page.

-tooltip

type: string

Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.

-onShowHelp

type: string (default: "")

Tcl command which is executed in the global scope if the "show-help" signal is recieved, which is normally the case if the user presses F1 or Ctrl-F1. Before evaluation the following percent strings are substituated TABLE %% | % %w | widget name %h | help type: either "whatsThis" or "tooltip" TABLE

-name

type: string

Name of the widget, can be used to set options in an rc file.

-visible

type: boolean (default: 1)

Whether or not the item is visible.

-sensitive

type: boolean (default: 1)

Whether or not the item is sensitve 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

results in

See also

box, table, paned, GtkNotebook