(* button-bar.sig *) (* Copyright (C) 2006 Alley Stoughton This file is part of crypto, a cryptogram encoder/decoder. See the file COPYING.txt for copying and usage restrictions *) (* button-bar widget *) signature BUTTON_BAR = sig type button_bar (* create a button-bar widget with buttons labeled by the supplied strings; buttons may be active or inactive; initially, and after a button-press, they are all inactive the widget may be customized using the following resource attributes: Name Type Default Semantics ----------------------------------------------------------------------- background color grey background color of widget's window foreground color black foreground color of widget's window font font 9x15 font of widget's window pad int 5 (pixels) inter-button padding borderWidth int 4 (pixels) border width of buttons *) val buttonBar : Widget.root * Widget.view * Widget.arg list -> string list -> button_bar (* returns an event that, when synchronized with, will return the label of the active button that the user clicked on (pressed and then released while staying within the button); it is safe for an application to fail to synchronize on this event for an arbitrary period of time *) val labEvtOf : button_bar -> string CML.event exception WrongNumber (* setActive returns a function that, when called with a list of booleans whose length is equal to the number of buttons of the button-bar, will make the corresponding buttons active (true) or inactive (false); if the function is called with a list of a different length, then WrongNumber is raised *) val setActive : button_bar -> bool list -> unit (* returns the widget of a button-bar *) val widgetOf : button_bar -> Widget.widget end;