The Button Display Class

This is the display class for functions. The display is a labelled button, and when the button is pressed the associated function is executed. (To press a button, move the mouse cursor onto it and click the left button on the mouse.) The function must be monadic or niladic. Specifically, let fn be a monadic function and define a(fn;data). Then the object a can be bound to the class button, and whenever the button is pressed, fn{data} is executed. A second form for defining a button is a<{fn}, which is equivalent to a(fn;) for monadic functions; when the button is pressed, the expression fn{()} or, for a niladic function, fn{} is executed. A dependency of the form a:<{fn} can also be bound to the button class; the value of this indirection is that the button will always invoke the latest definition of fn, since a change to fn will invalidate a and cause <{fn} to be evaluated again.

Note that the value of a variable bound to the button class is never a function, but rather is or includes a function array.

Visual Representation
  fn{s}:s                   fn prints its argument
  b(fn;"Pressed!")          Pressing button prints "Pressed!" in log
  show `b has (`class;      `button;
               `shelltitle; "ShellTitle";
               `title;      "Press this button")
For information about a widget element, click the left mouse button with the tip of the pointer index finger on it. Point inside the frame but outside the widget for attributes governing overall size, position, etc.

The element you are pointing at is named in the status message area at the bottom of the window.

(Clicking the middle mouse button instead displays this information in a new browser.)


Attributes

See the "Display Attributes" chapter for details concerning all the attributes that apply to objects in the button display class, as well as lists of colors and fonts. The keys in the Table of All Display Attributes that pertain to this class are U, ALL, CNFT, NFT, and TOP.

The attributes that are meaningful for the button display class (other than the print... attributes) are:

acceptfocus
active
ancestors
arrowdown
arrowkeys
arrowleft
arrowlist
arrowright
arrowup
at
atsector
b
bg
bound
class
clear
deiconized
doc
downto
dynamic
eval
evaluate
exit
extent
f1-f12
fg
font
fkeys
focus
followers
followertree
foot
freeze
fullscreen
h
H
has
head
hide
hl
hlthickness
icon
iconic
iconized
icontitle
incurrentworkspace
is
justify
l
leader
leftto
literal
lower
mapped
margin
naturalsize
notify
outofcurrentworkspace
parent
pin
preset
primary
protect
protected
r
raise
realize
refresh
request
resize
resizeable
rightto
script
sensitive
set
settings
shadowthickness
shell
shelltitle
show
state
stateself
syncshow
t
tabfrom
tablist
tabto
upto
title
titlefg
titlefont
titlejustify
vcol
vcols
verify
vrow
vrows
w
W
ws
x
X
xs
y
Y
ys
yx
YX
yxs
(Point the mouse cursor to an attribute to display a short description at the bottom of the screen)


doc@aplusdev.org© Copyright 1995–2008 Morgan Stanley Dean Witter & Co. All rights reserved.