Access control idea in the manual
Reading pristine 17 done, 144 queued. 0000034190-3e421e2c772f3697dba1ce5d58bb893
Sat Jan 16 08:11:48 PST 2010 marianomontone@gmail.com
* Access control idea in the manual
diff -rN -u old-gestalt/doc/gestalt.texinfo new-gestalt/doc/gestalt.texinfo
--- old-gestalt/doc/gestalt.texinfo 2014-04-18 11:23:11.000000000 -0700
+++ new-gestalt/doc/gestalt.texinfo 2014-04-18 11:23:12.000000000 -0700
@@ -1583,6 +1583,15 @@
@section Access control
@cindex access control
+@example
+(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