[manual index][section index]

NAME

Dividers - user-draggable tk dividing bars

SYNOPSIS

include "dividers.m";
dividers := load Dividers Dividers->PATH;
Divider: import dividers;

init: fn();
Divider: adt {
    new: fn(win: ref Tk->Toplevel, w: string, wl: list of string, dir: int):
        (ref Divider, chan of string);
    event: fn(d: self ref Divider, e: string);
};

DESCRIPTION

Dividers presents an interface allowing Tk widgets to be arranged within a window, divided by bars which can be dragged by the user to determine the proportion of the available space to allocate to each widget. The groups can be stacked vertically or horizontally. Divider widgets can be nested.

Init must be called before anything else, to allow Dividers to initialise its internal state. Divider.new creates a new divider widget; it will be named w, and it will divide up the widgets named in the list wl. Dir can be Dividers->NS, to stack the widgets one on top of another, or Dividers->EW to stack the widgets left-right. Divider.new returns a new Divider adt, and a channel through which Divider events will be received. The application should arrange that events received on this channel be passed to the event() function.

A Divider widget must be informed if its size has changed by configuring its width and height appropriately; it does the same to the items it is dividing.

SOURCE

/appl/lib/dividers.b

BUGS

It should not be necessary to inform the Divider widget of size changes.

The event-based mechanism seems somewhat contrary to the preferred Limbo way of doing things.

DIVIDERS(2 ) Rev:  Thu Feb 15 14:43:27 GMT 2007