Command: wtab

Syntax

{ <window> = } wtab <file>

    or

{<window> = } wtab "{"
    <sub_panel_block>
"}"

Description

Define a tab window, which is a panel window with a set of canvas windows selectable by a row of tab buttons, followed optionally by other sub-panels.

Parameters

Switches

Block

The <sub_panel_block> or the contents of <file> is made up of definition statements each describing a sub-panel or providing control information for layout purposes.

The window must have as its first sub-panels one or more sub-window definitions. These become selectable by clicking on the tab buttons across the top of the window, so that only one sub-window is visible at any time.

The general form is:

{<name> :} <window-command> {<parameters>} {<switches>}

where:

For details of window-command parameters and switches, consult the relevant command. For additional switches pertaining to a sub-window's use within the tab window, refer to the SubWindow Switches paragraph below.

In addition to sub-windows, other sub-panels may be added to the tab window, e.g. push buttons etc. These are displayed below the sub-window area. Their definition is the same as those in panel windows and their general form is:

{<name> :} <sub-panel> {<parameters>} {<switches>}

Please refer to the wpanel command for a description.

Subwindow Switches

These are switches which may be added to a window creation command, e.g. wgraphic, when used within a tab window.

 A value of "LRTB" means that the left, right, top and bottom edges of a sub-window are linked to its parent. The default value is "TL", which links the left and top edges to the parent tab window but does no resizing because its right and bottom edges are not linked. More complicated linkage requirements should be done via the window.resize callback on the parent tab window.

Notes

Interaction with sub-panels may be made during command polling or during pop-up menu selection when used with the -m option.

Details of sub-panel attributes may be examined or set after window creation via the window structure member panels.
Details of tab button attribues may be accessed via the structure member tab_buttons.

Once a tab window is displayed, sub-window selection is made interactively by clicking on the appropriate tab button. Programmatic selection is made by setting to 1 the visibility attribute of a sub-window, or via the selected attribute of the parent tab window.

Examples

# Create a simple resizable tab window to display 4
#    elevation views of the current entity graphics
    window tabwin = wtab -tit='Elevations',-no_fix {
    # The first section comprises 4 sub-windows
        gnorth: wgraphic -dim=<400,400>,-tit='North',-link='TLBR'
        gsouth: wgraphic -dim=<400,400>,-tit='South',-link='TLBR'
        geast: wgraphic -dim=<400,400>,-tit='East',-link='TLBR'
        gwest: wgraphic -dim=<400,400>,-tit='West',-link='TLBR'
    # The second section comprises one push-button sub-panel
        gap 10
        b: button 'Close',-link='B'
        gap 10
    }
 
# Set up initial views
    north tabwin.gnorth
    south tabwin.gsouth
    east tabwin.geast
    west tabwin.gwest
 
# Simple termination button callback
    tabwin.b.exec = {
        args w=window
        ifyes 'Are you sure' { wdelete w }
    }

See Also

Commands:

choice, embed, hint, poll, wclose, window, wopen, wpanel, wsize

Identifiers:

free_window (window), new_window (window), win# (window), window_numbers (numeric)

Panels:

all

Structures:

panel, window