Hi Offray, As Doru mentioned, without a complete example it is difficult to reproduce and analyze your problem. For the tree to get updated on node addition or removal, you need to use GLMAnnouncingCollection to group your nodes. Hence, when you add a new node in your announcing collection object, this code comes into effect: updateOn: GLMItemAdded from: #yourself; So, make sure you are using appropriate collection object. usman On Wed, Aug 13, 2014 at 2:19 AM, Offray Vladimir Luna Cárdenas < offray@riseup.net> wrote:
Hi again,
I'm looking at the code at Updataeble Browser in the Basic Examples and I have done some small modifications. The code I have (see below) is running without error, so I suppose that nodes are being added, but the tree view is not updated. My guess is that this is done with "updateOn:" message, but I would like to know, what I'm missing.
Here is my code
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- | browser mainTree | mainTree := UbakyeNode new. mainTree becomeDefaultTree. browser := GLMTabulator new. browser column: #preview. browser act: [:newNode | newNode := UbakyeNode header: 'nuevoNodo' body: ''. mainTree addNode: newNode.] icon: GLMUIThemeExtraIcons glamorousAdd entitled: 'Add an item in the collection'. browser act: [:b | b entity removeLast. b update ] icon: GLMUIThemeExtraIcons glamorousRemove entitled: 'Remove last item from the collection'. browser updateOn: GLMItemAdded from: #yourself; updateOn: GLMItemRemoved from: #yourself. (browser transmit) to: #preview; andShow: [ :a | a tree title: mainTree header; children: [:eachNode | eachNode children ]; format: [:eachNode | eachNode header ]. a text title: 'Text']. browser openOn: mainTree. =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
An UbakyeNode is a simple data structure with a header (text), a body (text) and a list of children, wich are also Ubakye nodes.
Any advice is welcomed, as always,
Offray
On 08/12/2014 04:42 PM, Offray Vladimir Luna Cárdenas wrote:
Hi,
On 08/12/2014 03:13 PM, Tudor Girba wrote:
I do not understand exactly what you did. Could you be more explicit about where the error happened?
I'm not able to reproduce it again. But as soon as I can catch it again, I will be doing it.
Also, the code you provide depends on the data you have. This makes it
difficult for us to reproduce the issue. If you want to have quicker answers you could try providing an example that works with simpler objects, or at least provide a script to setup the data as you need it.
That's why I was asking (in other thread) how to point to my code online. I'm using SmalltalkHub to share this learning project here:
http://smalltalkhub.com/#!/~Offray/Ubakye/
but would be nice to point to a published snippets of code about this questions. May be I just don't understand how to point to specific code online like usually happens with DVCS like fossil or git.
Anyway if you can load my code from this repository you can then open a Playground and run:
UbakyeBrowser open.
to see the context I'm talking about.
Meanwhile, let me illustrate my next question with a image. I have already a browser with three panels, as shown here:
http://www.enlightenment.org/ss/e-53ea868b320b20.66100223.jpg
- The tree panel, at the left for showing node titles (headers). - The content panel, at the top right for showing node content (bodies). - The code panel, at the bottom right for writing Smalltalk code.
I'm able to send message from code panel to another "external" objects, like the usual Transcript, but I would like to be able to send messages from the code panel to the tree that is being shown in the browser. I would like to start with adding nodes to the current tree, and changing its values. How can be this done?
Thanks for Glamorous Toolkit. I'm really enjoying being able to prototype new tools as fast, despite of being a newbie (¡Power to the (newbie) user! --also).
Cheers,
Offray