The scrolledframe widget

In Brief

This is a scrolled frame widget which will use the Pinstripe texture when the platform is a Mac and default to your current Tile theme's frames elsewhere.

This widget scrolls without any texture misalignment at any point in the scroll.

The scrolledframe first appeared in TclMacBag v0.09.

Commands

::tclmacbag::scrolledframe pathName

Example

grid [::tclmacbag::scrolledframe .sf] -row 1 -column 1 -sticky nsew
grid [ttk::scrollbar .sb -command {.sf yview}] -row 1 -column 2 -sticky nse
grid [ttk::label .sf.scrolled.l -text "Hello world."]

Further Information

The frame to pack your widgets into is $w.scrolled. Don't pack them directly into $w.

This widget depends on the Tk texture colour names in Tk 8.4.15 and above (including Tk 8.5.x).

This widget was mostly written by Maurice Ulis and Keith Nash and the original appears on the Tclers Wiki here. The main code changes (aside from some namespace renaming) is the switch to call internal Tk frames with the Pinstripe colour or Tile/Ttk frames when appropriate.

It can be argued that a scrolled frame is a rather non Mac native way of doing things. An approach used by Apple designed apps is to automatically resize the toplevel to its packed contents cumulative size instead.

As is standard, ::tclmacbag::scrolledframe returns with value of pathName, for ease of use with geometry managers like grid and pack.

This widget is based on the scrolled frame by Maurice Ulis.

Bugs

Unfortunately, this widget is fairly buggy at the moment.

Hope to get this sorted out over the Christmas/New Year break.