The figure<-status
of a figure is a name indicating which graphicals of the figure should
be visible: if figure<-status
equals all_active, all
device<-graphicals
are visible, otherwise only graphicals with the same name as figure<-status
are made visible.
This mechanism may be used to define graphical
objects that should be switched between different states. Consider the
example where we want to have a diagram which can be displayed opened
and as an icon. The code below outlines a possible
approach:
create_closable_diagram(F) :-
new(F, figure),
send(F, status, opened),
send(F, display, new(BM, bitmap('my_icon'))),
send(BM, name, closed),
send(BM, recogniser,
click_gesture(left, '', double,
message(F, status, opened),
send(F, display, new(F2, figure)),
send(F2, name, opened),
...
<create the real diagram on F2>