... I pressed too early

browser transmit to: #two; from: #one; when: [:node | node isKindOf: TreeNode]; andShow: [ :a | 
    a text display: [:x | 'Attribute List ', x printAttributes  ] ].

It's not the nicest solution, but it should do the job in your case.

Cheers,
Doru




On Sun, Aug 25, 2013 at 12:42 PM, Tudor Girba <tudor@tudorgirba.com> wrote:
One way would be to simply put conditions to when the transmission gets transmitted.

Suppose that the nodes are of type TreeNode and the tokens are of different type. Then you can use:

browser transmit to: #two; from: #one; andShow: [ :a | 
    a text 
display: [:x | 'Attribute List ', x printAttributes  ] ].

Cheers,
Doru


On Sun, Aug 25, 2013 at 11:58 AM, Mohammad Al Houssami (Alumni) <mha53@mail.aub.edu> wrote:

Hello everyone,

First of all thanks to Tudor Girba for letting me know about the mailing list J

 

I am new to Glamour.
I was checking the examples and checking the code for the tree with expansion code. I am trying to add tabs. The only problem is that the tabs don’t have a similar function and I don’t want the transmit part to work for both.
To make things clearer I have want to show a DOM Tree in one column and when the tree is navigated attributes are shown on the second column. I want to have another tab that will just show the list of tokens that have been created during the parsing process. Because they are different, when you click on a token an error will be displayed because it does not understand the message being called.

Here is the code I have:

 

browseTree: htmlString

|browser domTree |

domTree := TreeConstruction new parse: htmlString.

                browser := GLMTabulator new.

                browser column: #one; column: #two.

                browser transmit to: #one; andShow: [:a |

                                a tree

                                                title: 'DOM Tree Browser';

                                                display: [ domTree htmlDocument  nodes first ];

                                                children: [:element :i | element  nodes];

                                                format: [:node|  node name].

                                a tree

                                title: 'Tokens List';

                                display:[domTree tokens]."Tokens get displayed here "                                                                             

                                                ].

                browser transmit to: #two; from: #one; andShow: [ :a | a text display: [:x | 'Attribute List ', x printAttributes  ] ].

                browser openOn: domTree  .

How can I achieve that? Or that is not possible?


_______________________________________________
Moose-dev mailing list
Moose-dev@iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"



--
www.tudorgirba.com

"Every thing has its own flow"