include "wmlib.m"; wmlib:= load Wmlib Wmlib->PATH; Resize, Hide, Help, OK: con 1 << iota; Appl: con Resize | Hide; init: fn(); titlebar: fn(t: ref Tk->Toplevel, title: string, buts: int) : chan of string; titlectl: fn(t: ref Tk->Toplevel, request: string); taskbar: fn(t: ref Tk->Toplevel, name: string): string; getfilename: fn(screen: ref Draw->Screen, parent: ref Tk->Toplevel, title, pat, dir: string) : string; geom: fn(t: ref Tk->Toplevel) : string; snarfput: fn(buf: string); snarfget: fn(): string;
A channel is returned by titlebar by which the application is informed of Tk events (See tk). Messages received on it should be processed by the application. The messages that may arrive on the returned channel are:
In some cases the appropriate response is make the received message
titlectl (t, request)
The titlectl function performs a variety of operations according to the string passed in argument request. The supported requests are:
taskbar (t, name)
The taskbar function changes the name displayed in the title bar and the window's name when it is in the task bar. getfilename (screen, parent, title, pat, dir)
The getfilename function makes a dialog box for selecting a file. It is displayed on screen near parent. The dir argument gives the directory where the file search should begin. Only files that match pattern pat are displayed. The rules for defining match patters are described on lib-filepat. geom (t)
The geom function returns a string with the coordinates for a child window. snarfget ( ) and snarfput (buf)
The snarfget and snarfput functions retrieve and replace the contents of the window manager's snarf buffer. Files
/chan/wm
|
Interface with wm for the titlectl function's handling of "move" and "size" requests.
|
/chan/snarf
|
Interface with wm for the snarfget and snarfput functions.
|