How to redraw a PluggableTreeMorph when its contents change

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How to redraw a PluggableTreeMorph when its contents change

Rob Rothwell
Thanks to the TreeMorph Pharocast (thank you!) and some digging, I have added a context menu to a PluggableTreeMorph that lets me add a child to a selected node (I am just using the idea of nested "accounts"):

addAccount
    | isExpanded |
    aTreeMorph  selectedMorph complexContents item addAccount:
        (Account new accountName: (UIManager default request: 'Enter a new account name:')).
    isExpanded := aTreeMorph selectedMorph isExpanded.
    aTreeMorph toggleExpandedState: aTreeMorph selectedMorph.
    isExpanded ifTrue: [aTreeMorph toggleExpandedState: aTreeMorph selectedMorph.]

But as you can see I can only figure out how to show new nodes by toggling the expanded state, which is really not helpful if you want to rename, delete, etc...  Is there a way to somehow just inform the PluggableTreeMorph to redraw itself after changing its contents?

Thank you,

Rob


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project