NAME
Tk::DynaTabFrame - An alternative to the NoteBook widget : a tabbed geometry manager with dynamically stacking tabs (yeah!)
SYNOPSIS
use Tk::DynaTabFrame;
$TabbedFrame = $widget->DynaTabFrame
(
-font => '-adobe-times-medium-r-normal--20-*-*-*-*-*-*-*',
-tabcurve => 2,
-padx => 5,
-pady => 5,
-raisecmd => \&raise_callback
-tablock => undef
[normal frame options...],
);
font - font for tabs
tabcurve - curve to use for top corners of tabs
padx - padding on either side of children
pady - padding above and below children
raisecmd - code ref invoked on a raise event; passes
the caption of the raised tab
tablock - locks the resize of the tabs; when set to a true
value, the tabs will not be rearranged when the enclosing
window is resized; default off (ie, tabs are rearranged
on resize)
$CurrentSelection = $Window->cget ('-current');
$CurrentSelection = $Window->cget ('-raised');
$CurrentCaption = $Window->cget ('-raised_name');
current - (Readonly) currently selected widget
raised - (Readonly) currently selected widget
raised_name - (Readonly) caption of currently selected widget
$Tabs = $Window->cget ('-tabs');
$Tabs - a hashref of the tab Button widgets,
keyed by the associated caption. Useful for
e.g., attaching balloons to the tabs
$frame = $TabbedFrame->add
(
-caption => 'Tab label',
-tabcolor => 'yellow',
);
caption - label text for the widget's tab
tabcolor - background for the tab button
Returns a new Frame widget to be populated by the application.
$TabbedFrame->delete($caption);
Deletes the tab/frame specified by $caption (if it exists).
$TabbedFrame->raise($caption):
Raises the tab/frame specified by $caption (if it exists).
Values shown above are defaults.
DESCRIPTION
[ NOTE: This module is derived directly from Tk::TabFrame... tho you probably can't tell it anymore ]
A Notebook with dynamically rearranging tabs. When you resize a window, the tabs will either stack or unstack as needed to fit the enclosing widget's width. Likewise, when tabs are added or removed, the tabs will stack/unstack as needed.
Tabs are added at the bottom row, left side, and automatically become the "raised" tab upon being added. The tabs can be raised by both mouse clicking, or by using left and right keyboard arrows to traverse the tabbing order. If a tab in a row other than the bottom row is raised, all rows are rotated down, with bottom rows wrapping back to the top, until the raised row is moved to the bottom row.
NOTE: As of V. 0.02, unfilled top rows no longer cause all tabs to rearrange when the top row is raised. However, removing or adding a tab, or resizing the enclosing widget with -tablock turned off, *does* cause tab rearrangement.
CAVEATS
As of v 0.02, this widget may be appropriate for configuration dialogs, as the tab movement is no longer chaotic, assuming no tab removals/additions occur, and -tablock is turned on, after the initial dialog setup is complete.
Other corrections for Ver. 0.02 include improved tabbing order via the keyboard so it is possible to completely traverse tabs, eliminating the flickering effect when adding/raising/deleteing tabs, and use of default platform/ application fonts when none is explicitly defined.
Use with *optional* horizontal scrolled frames (ie, 'os') seems to cause some race conditions (Config events keep resizing the frame up, then down). Use mandatory scrollbars if you need horiztonals.
AUTHORS
Dean Arnold, darnold@presicient.com
HISTORY
January 16, 2004 : Ver. 0.06 - fixed programmatic raise - added (simple) install test - added programmatic raise button to demo app
January 13, 2004 : Ver. 0.05 - added "pseudo-tabs" to backfill the space between the right side of last tab in a row, and the right side of the enclosing frame
January 6, 2004 : Ver. 0.04 - fixed TabRemove for remove from arbitrary position - updated demo app to exersize arbitrary position removal - fixed apparent timing issue with TabRemove and resizing that caused occasional phantom client entries
January 5, 2004 : Ver. 0.03 - added raised_name() method/-raised_name property to return caption of currently raised page - fixed tab ordering on resize when raised tab gets moved to other than bottom row
December 29, 2003 : Ver. 0.02 - improve raise behavior - improve tab font behavior (use platform/application default when none specified) - added tablock option
December 25, 2003 : Converted from Tk::TabFrame
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 1023:
=cut found outside a pod block. Skipping to next block.