Go to the first, previous, next, last section, table of contents.

Packer in action

The Packer is the layout abstraction that is commonly used in Tcl/Tk circles. It provides tiling layouts and through the use of packing attributes to configure how to pack elements, flexible and cheap layout is possible.

As an example of what the Packer can do, here is a standard Tk example:


main =
 mkDC ["*name: Packer"]  >>= \ dc ->
  button (text "OK")     () dc >>= \ (_,dh1) ->
  button (text "Cancel") () dc >>= \ (_,dh2) ->
  button (text "Help")   () dc >>= \ (_,dh3) ->
  mkPacker [PackerSide West,
            PackerFill FillX,
            PackerExpand True] 
           [dh1,dh2,dh3] dc    >>= \ (p,dh) ->
 realiseDH dc dh               >>
 return ()

Packer ex.


Go to the first, previous, next, last section, table of contents.