class
superclass:canvas%
constructor
[labellabel][bitmapbitmap][callbackcallback][ [alternate-bitmapalternate-bitmap][vertical-tight?vertical-tight?][min-width-includes-label?min-width-includes-label?]][right-click-menuright-click-menu]...superclass-args...)The callback is called when the button is pressed. The label and bitmap are used as discussed above.If alternate-bitmap is supplied, then it is used when the label is not visible (via a call to set-label-visible ). If it is not supplied, both modes show bitmap.
If the vertical-tight? argument is #t, then the button takes up as little as possible vertical space.
If the min-width-includes-label? is #t, then the minimum width includes both the bitmap and the label. Otherwise, it includes only the bitmap.
If right-click-menu is not #f, then right click (or control click on some platforms) opens a context sensitive menu under the button with one menu item whose label is the string and whose callback is the thunk.
Changed in version 1.76 of package gui-lib: Added the right-click-menu argument
method
(send a-switchable-button set-label-visible visible?)→void?
visible?:boolean?Sets the visibility of the string part of the label.Calls the button’s callback function.method
(send a-switchable-button get-button-label )→string?
Returns the label of this button.method
(send a-switchable-button get-large-width )
Returns the width of the button when it would show both the label and the bitmap and when it is in label-visible mode (i.e., when set-label-visible has been called with #t).method
(send a-switchable-button get-small-width )
Returns the width of the button when it would show both just the bitmap (not the alternate bitmap), and when it is in label-visible mode (i.e., when set-label-visible has been called with #t).method
(send a-switchable-button get-without-label-small-width )
Returns the width of the button when it is not in label-visible mode (i.e., when set-label-visible has been called with #f).