help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] How to use trees with OrderedCollections etc


From: Nicolas Petton
Subject: Re: [Help-smalltalk] How to use trees with OrderedCollections etc
Date: Tue, 10 Nov 2009 11:18:40 +0100

Hi,

Since it's a tree widget, it expects an item of the tree to know its
children. This part is done in #childrenBlock:

The thing is that you're OrderedCollection is not a tree, so objects of
the collection don't have  children. So I don't think a tree widget is
what you need, I would rather use a simple list in your case.

Is there a reason why you want to use a tree widget?

Cheers!

Nico



Le mardi 10 novembre 2009 à 08:46 +0200, Bèrto ëd Sèra a écrit :
> Hi all,
> 
> one more stupid question. I've been building a UI mockup happily
> quoting the sample that reads
> 
>       tree := (Iliad.Tree new)
>                  item: Object;
>                  childrenBlock: [:class | class subclasses];
>                  contentsBlock: [:e :class | e text: class name]
> 
> it works perfectly. Then I spent quite a long time getting stuff out
> of PG, decoding the XML to make it in objects and I finally have
> something I can use. It's anOrderedCollection of symbols (uuids,
> actually) that I will later turn into properly localized objects
> depending on what language the users has chosen.
> 
> It looks like:
> An instance of OrderedCollection
>   firstIndex: 8
>   lastIndex: 16
>   contents: [
>     [1]: #'1aa75482-4e61-11de-a0cb-e7dd9793c483'
>     [2]: #'d39605ea-7929-11de-9575-839884ebf70c'
>     [3]: #'d3973a46-7929-11de-b337-4fd741cce41e'
>     [4]: #'d3984bca-7929-11de-a337-bb66b2b01db0'
>     [5]: #'d39968f2-7929-11de-bb33-83f0278053f7'
>     [6]: #'d39a6ebe-7929-11de-8ea2-5bd631a2b97f'
>     [7]: #'d39c66b0-7929-11de-9f31-1fcdae4e56a0'
>     [8]: #'d39d7e24-7929-11de-8f93-733ef5534d68'
>     [9]: #'d39e76a8-7929-11de-ad21-73754236fffa'
>   ]
> 
> Now, my idea was to move up the mock a bit by showing the uuids. Note
> that in this case it's not really a tree, yet. It will probably get to
> be one, but even if it doesn't I'd rather have the same widget for all
> lists, so users do not have to learn too much stuff before they can
> use the app.
> 
> Now, I probably need some sleep badly, but for the life of me I cannot
> figure out how to pass this collection to the tree and have it shown
> as a simple list. So while I wait for someone to shed light on my
> dumbness I'll go on with other parts of the code.
> 
> Berto
> 
> 
> _______________________________________________
> help-smalltalk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-smalltalk

Attachment: signature.asc
Description: Ceci est une partie de message numériquement signée


reply via email to

[Prev in Thread] Current Thread [Next in Thread]