[cells-devel] Controlling order of initialization?

Mikko Ahonen mikko.ahonen at grupposoftware.com
Thu Jul 10 22:29:29 UTC 2008


Hmm, here follows a question about controlling the order of initialization.

For example, let's assume we want to create a radio button group with
individual radio buttons as kids. The invidual radio buttons are generated
automatically based on the arguments passed to make-instance of the radio
button groups.

Thus, the kids are generated in the initialize-instance of the radio button
group. They must get created before call to apply-next-method. The problem
is that when I generate the child here, it wants to read stuff from the
parent, which is not yet completely initialized. For example, it wants to
read which kid is selected (parent's selected cell) before any kids even
exist!

I guess this is more generic problem of controlling the order of
initialization of children, and perhaps delaying it until after the
initialization of the parent. How do people usually go about doing this?

I can think of some work-arounds. For example set parent's selected cell to
nil, and then ignore this value in kids. Or define some new state cell in
the parent, which children watch for.

But isn't this a quite generic need in cells programs?

Best regards,

Mikko Ahonen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cells-devel/attachments/20080711/8341bbe3/attachment.html>


More information about the cells-devel mailing list