The PNB (Panther notebook) widget
In Brief
The PNB (Panther notebook) widget is a variant of the tab notebook which has the much of the appearance of notebooks in OS X from 10.3 ("Panther") and above.
On non-Mac platforms, it falls back to the standard Tile notebook. The old and new style Mac OS X notebooks are compared in Apple's Human
Interface Guidelines.
The PNB widget first appeared in TclMacBag v0.09 with what would now be considered the 'tnb' style.
Support for styles appeared from v0.18 onward.
Commands
::tclmacbag::pnb pathName ?Options?
- -style tnb|pill|chrome|steel|simple|safari|capsule
The name of the button decoration style to be used.
Style fashions change quite a bit in the Mac world, and the current rule seems to be: "Do whatever looks good."
The 'tnb' style provides the classic Panther Notebook look (pictured above) and is the default if you do not specify a -style option.
For the rest of the options, in general, use the same command set as
the Tile notebook.
However, the following options should not be used: -state, -image, -compound, -height, -underline.
Example
set pnb [::tclmacbag::pnb .nb]
$pnb add [ttk::frame $pnb.a1] -text "Cats"
$pnb add [ttk::frame $pnb.a2] -text "Monkeys"
$pnb add [ttk::frame $pnb.a3] -text "People"
pack $pnb -expand yes -fill both -padx 10 -pady 5
Known Bugs
There was a bug in the v0.09 release which impacted people who recreated the widget with the same pathName where the toplevel was marked resizable Off.
This was fixed in v0.10. See the Changelog for details.
PNB does not look good when created with only one tab in the notebook. So don't do that.
Further Information
The notebook presented by Tile's Aqua theme uses the older OS X 10.0-10.2 ("Jaguar") appearance. Tile's pending HITheme theme (in development at the time of writing) has a Panther style
notebook which may end up being more suitable for you than this widget.
Always control your toplevel's dimensions when using this widget (using either [wm geometry] and/or [wm minsize]) to ensure frame contents (including buttons) are visible.
PNB does not support pinstripe darkening inside notebook frames.