"Leslie P. Polzer" <[email protected]> writes:

> On Feb 17, 11:12 am, Jan Rychter <[email protected]> wrote:
>> Vyacheslav Akhmechet <[email protected]> writes:
>
>> > And of course one could implement (child-widgets parent-widget).
>>
>> Hmm. But how is that different from get-children-by-type? (except for
>> the fact that you can have only one child widget per name, which is a
>> limitation I would not be happy with)
>>
>> The above interface looks almost exactly like what I implemented, just
>> change the names.
>
> That's what I thought when I read it.
>
>> As I wrote before, I do not think storing widgets in slots is a good
>> idea at all, because by default they can't participate in flows. This
>> could change if someone hacks a general make-widget-place-writer for
>> widget slots.
>
> It wouldn't be hard to do this.
>
> I'm fond of the idea of storing widgets in slots, the children-of-type
> seems a bit clumsy in comparison.
>
> Are there any other disadvantages of using slots for children?

Three I can think of -- 1) the make-widget-place-writer problem
described above, 2) the need to supply an *additional* enumeration
function (which means lots of fun with method combinations to make it
work), and 3) if you want to control rendering in your specialized
subclasses, they still need to "know" about these slots and reference
them directly, which I'd say is just as clumsy as the solution I
implemented.

Of course there is also a small (4) -- get/set-children-of-type always
operates on lists, promoting widgets to lists if necessary, which means
you always use map on what get-children-by-type returns.

But, I think the only way to really know is to try -- I did, rewrote the
code a couple of times and ended up with a solution that is a
compromise. Like I said, I'm not that enthusiastic about it, but I think
it isn't such a bad compromise. If someone comes up with a better
working solution, I'd be more than happy to migrate.

--J.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to