Access control idea in the manual
Sat Jan 16 16:11:48 UTC 2010
* Access control idea in the manual
diff -rN -u old-gestalt/doc/gestalt.texinfo new-gestalt/doc/gestalt.texinfo
--- old-gestalt/doc/gestalt.texinfo 2017-05-24 06:08:30.645652531 +0000
+++ new-gestalt/doc/gestalt.texinfo 2017-05-24 06:08:30.685652329 +0000
@@ -1583,6 +1583,15 @@
@section Access control
@cindex access control
+(add-component 'button (make-instance 'button :action #'some-action)
+ :when (let ((model (model self)))
+ (df
+ (can-do-some-action model))))
+@end example
+In this case, the @emph{model} library in the @emph{df} form is free, so it is assumed to be a dataflow variable: whenever the model changes the @emph{can-do-some-action} condition is rechecked and the component is enabled or disabled accordingly.
@node Standard widgets
@section Standard widgets
@cindex widgets