<section ID="chapter.widgets.panel">
  <TITLE>Panel widget</TITLE>

<subsection> <TITLE>Description</TITLE>

<P>
The panel widget is a multi-recipient for frames. One frame can be displayed at a time, the user can switch between time by clicking tabs. Each frame is given a title that appears in its own tab. All tabs are displayed from left to right above the frames. If the width necessary to display all the tabs is greater than the width available, small arrows appears allowing to scroll the tabs. Frames can be defined at creation time, and can also be added or removed dynamically.

<subsection> <TITLE>Parameters</TITLE>

<P>
<LIST>

<ITEM> <<n:R>> : With <<n>> starting at <<1>> and going up one by one. These parameters are valid at creation time only. Specifies a widget to place inside the frame. <<R>> must be a record describing a widget. In this particular case, the record has a supplementary parameter : <<title:VS>>. The virtual string <<VS>> specifies the text that is displayed in the tab associated with the widget.

&param_borderwidth;
&param_cursor;
&param_highlightbackground;
&param_highlightcolor;
&param_highlightthickness;
&param_relief;
&param_takefocus;
&param_background;

<ITEM> <<class:VS>> : Specifies a class for the window. This class will be used when querying the option database for the window's other options, and it will also be used later for other purposes such as bindings. This option can be specified at creation time only. <<VS>> must be a virtual string.

<ITEM> <<colormap:V>> : Specifies a colormap to use for the window. The value may be either the atom <<new>>, in which case a new colormap is created for the window and its children, or the handle of another window (which must be on the same screen and have the same visual as this widget), in which case the new window will use the colormap from the specified window. If the colormap option is not specified, the new window uses the same colormap as its parent. This option can be specified at creation time only.

<ITEM> <<width:P>> : Specifies the desired width for the window. If this option is less than or equal to zero then the window will not request any size at all. <<P>> must be a valid screen distance (see <ptr to="misc.distance">).

<ITEM> <<height:P>> : Specifies the desired height for the window. If this option is less than or equal to zero then the window will not request any size at all. <<P>> must be a valid screen distance (see <ptr to="misc.distance">).

<ITEM> <<visual:A>> : Specifies visual information for the new window. <<A>> must be one of the following atoms : <<directcolor>>, <<grayscale>>, <<greyscale>>, <<pseudocolor>>, <<staticcolor>>, <<staticgray>>, <<staticgrey>>, or <<truecolor>>. If this option is not specified, the new window will use the same visual as its parent. This option can be specified at creation time only.

&param_font;
&param_glue;
&param_padx;
&param_pady;
&param_feature;
&param_handle;
&param_tooltips;


</LIST>

</P>

<subsection> <TITLE>Interface</TITLE>

<P>
The object you get by an handle on the widget implements the following methods :

<LIST>

<ITEM> <<addPanel(D before:B after:A)>> : Adds a frame to the panel. <<D>> must be a record describing a widget. This widget has a supplementary parameter : <<title:VS>>. <<VS>> must be a virtual string describing the text to display in the tab corresponding to the widget. If the <<before:B>> parameter is pecified, <<B>> must be an handle to a widget displayed in the panel to insert <<D>> just before <<B>>, or <<B>> must be the atom <<all>> to insert <<D>> before all other widgets in the panel. If the <<after:A>> parameter is pecified, <<A>> must be an handle to a widget displayed in the panel to insert <<D>> just after <<A>>, or <<A>> must be the atom <<all>> to insert <<D>> after all other widgets in the panel. If both <<before>> and <<after>> are specified, only <<after>> is taken into account. If none are specified, <<after:all>> is assumed by default.

<ITEM> <<selectPanel(O)>> : Selects a widget to display in the panel. <<O>> must be an handle to a widget that is in the panel.

<ITEM> <<deletePanel(O)>> : Removes a widget from the panel. <<O>> must be an handle to a widget that is in the panel.

&interface_set;
&interface_get;
&interface_bind;
&interface_getFocus;
&interface_setGrab;
&interface_releaseGrab;
&interface_getGrabStatus;
&interface_raise;
&interface_lower;
&interface_winfo;

</LIST>

</section>
