Date: Mon, 26 Jul 2010 22:03:26 -0400
From: Rob Rothwell <r.j.rothwell@gmail.com>
Subject: [Pharo-project] How to interactively add items to a tree
� � � �widget?
To: "Pharo-project@lists.gforge.inria.fr"
� � � �<pharo-project@lists.gforge.inria.fr>
Message-ID:
� � � �<AANLkTimBNqkvGnUMFHSqRJOJ8WqJdPwynbxCDym4AJk+@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"
This is probably a pretty newbie question, but can anyone point me towards
creating some code to right click on a tree item and add a pop-up menu so I
can prompt for some input and create a new child of that node?
I figured out how to change the contents of the tree in UITheme
exampleBasicControls by creating a Dictionary with some child Dictionaries
containing some objects, but now I seem to have a few challenges:
1. �The items are not being highlighted when I click on them (they aren't in
the example either).
I have the same problem, so if you find how to make it works i'm listening ^^
�
2. �I need a nudge in the right direction to capture the right click.
Maybe you should rewrite the mouseDown: method and add a test like
��� event yellowButtonPressed (or the button you want)
�������� ifTrue: [ "popup a menu" ]
�
3. �If I do that and successfully add a new child to a node, I don't know
how to tell the tree to refresh itself...
Send the message updateList to your MorphTreeMorph. If you have correctly build your tree it works great ( but the highlighting doesn't work :s )
Good luck
Benjamin