include "tabs.m"; tabs := load Tabs Tabs->PATH; init: fn(); mktabs: fn(p: ref Tk->Toplevel, book: string, tabs: array of (string, string), dflt: int): chan of string; tabsctl: fn(p: ref Tk->Toplevel, book: string, tabs: array of (string, string), curid: int, newid: string): int;
Init should be called once to initialise the internal state.
Mktabs creates a tabbed notebook pseudo widget, book, for insertion into Tk widget p. Once created, book can be packed like any other Tk widget. Information for specific tab pages is contained in the tabs array. For each page, tabs contains the name displayed in the tab and a Tk widget name. Whenever a page is selected, its widget is packed in book and displayed. The notebook will initially display the page indexed by dflt. Mktabs returns a Tk event channel. Messages received on this channel should be passed as the newid argument to tabsctl.
Tabsctl controls a tabbed notebook. Curid is the index of the page currently selected in the notebook. Newid is a string containing the index of the new page to be displayed; this is usually the information received on the tabs channel. The index of the newly selected page is returned.
|TABS(2 )||Rev: Tue Mar 31 02:42:39 GMT 2015|