[cells-gtk-devel] simple example / beginner
Kenny Tilton
kennytilton at optonline.net
Tue Sep 9 02:44:09 UTC 2008
Olof-Joachim Frahm wrote:
> Hello,
> using the patch to the current cffi (1.10.1) version I managed to run
> cells-gtk (cvs version).
> Now what I don't get, since the test-gtk example won't run, is, how this
> small example:
>
> (defmodel gtk-browser (gtk-app)
> ()
> (:default-initargs
> :title "GTK Cells Example"
> :kids (list (mk-label :text "Foo!"))))
>
> can be modified so that it's valid. At the moment this leads to
> "New as of Cells3: parent must be supplied to make-instance LABEL ..."
>
> Exchanging the :kids line with
>
> (c? (list (mk-label :text "Foo!" :fm-parent self)))
>
> works. So my question is, what did I get wrong :)
Nothing.
> or better, how can I
> specify the model without having a c? in front, since (this part of the)
> UI is static and not computed by a formula.
Formulas for initforms/initargs are cool not just when things change
over time but /also/ because they make the instance being initialized
visible to the initializing form, so in that sense the c? is not
superfluous, it is just performing one of its less heroic roles. There
will not be much performance penalty, btw, becasue the rule gets
optimized away if indeed there are no dependencies.
To totally avoid the rule, well, I actually forget how that requirement
came about. You oculd always turn off the assertion, setf the parent in
the kids observer, and see what happens.
Me, I just toss in the (c?...) and get on with the app.
kt
--
http://www.theoryyalgebra.com/
More information about the cells-gtk-devel
mailing list