View · Search · Index
No registered users in community xowiki
in last 10 minutes

RE: [Xotcl] Ordering of Children

From: Matthew Dodwell <mjd_at_orcaspirit.co.uk>
Date: Fri, 3 Feb 2006 11:21:11 -0000

Thanks - I'll give that a go.

Matthew

-----Original Message-----
From: xotcl-bounces_at_alice.wu-wien.ac.at
[mailto:xotcl-bounces_at_alice.wu-wien.ac.at]On Behalf Of Neophytos
Demetriou
Sent: 02 February 2006 19:48
To: xotcl_at_alice.wu-wien.ac.at
Subject: Re: [Xotcl] Ordering of Children


Matthew Dodwell wrote:
> MemoryLineController instproc AddNode {name} {
> eval GUINode [self]::[my autoname gNode%02d] -DisplayName {$name}
> }

* Replace the body of addNode as follows:

        my lappend __children [eval GUINode ...etc... ]

    and [my info children *gNode*] in CreateTreeview as follows:

        [my set __children]

OR

* Use an OrderedComposite class that does it for you. You will either
have to mix it in or define it as one of the superclasses of
MemoryLineController, i.e.:

        Class MemoryLineController -superclass OrderedComposite


Class OrderedComposite

OrderedComposite instproc children {} {
   set children [expr {[my exists __children] ? [my set __children] : ""}]
   return $children
}
OrderedComposite instproc add obj {
   my lappend __children $obj
   $obj set __parent [self]
}


Best,
Neophytos
_______________________________________________
Xotcl mailing list
Xotcl_at_alice.wu-wien.ac.at
http://alice.wu-wien.ac.at/mailman/listinfo/xotcl