Hi,
Any help with this from anybody? I would like to work on this for a
workshop tomorrow on data visualization with Pharo.
Thanks,
Offray
On 10/12/2014 11:41 PM, Offray Vladimir Luna Cárdenas wrote:
Hi,
I'm creating a menu for loading, storing files from my outliner and
updating the software. The interface is something like:
============================
buildBrowser
"Main method for building the interface for trees. Is getting long.
Needs refactoring"
browser := GLMTabulator new
title: 'Grafoscopio'.
browser
column: #tree span: 2;
column: [ :c |
c row: #nodeBody span: 2;
row: #nodeHeader ] span: 4.
browser
updateOn: GLMItemAdded from: #yourself;
updateOn: GLMItemRemoved from: #yourself.
(browser transmit)
to: #tree;
andShow: [:a | self treeOn: a].
"Creating a self updatable body pane"
(browser transmit)
to: #nodeBody;
from: #tree;
andShow: [ :a | self bodyOn: a].
(browser transmit )
from: #tree port: #selection;
from: #nodeBody port: #text;
when: [:node :text | text notNil];
to: #nodeBody port: #neverland;
transformed: [:node :text | node body: text asString].
(browser transmit)
from: #tree;
to: #nodeHeader;
andShow: [ :h | self headerOn: h ].
(browser transmit )
from: #tree port: #selection;
from: #nodeHeader port: #text;
when: [:node :text | text notNil];
to: #nodeHeader port: #neverland1;
transformed: [:node :text | node header: text asString]
============================
The "treeOn:" code for the menu is something like:
============================
treeOn: constructor
"Shows the correspondent tree of a node"
(constructor tree)
"Snipped code"
act: [ UbakyeBrowser new openFromFile] entitled: 'Open/Load ...';
act: [:x | x inspect] entitled: 'Save as ...';
act: [:x | x inspect] entitled: 'Update Grafoscopio';
act: [:x | x printString inspect] entitled: 'About ...'.
============================
Of course, the [:x | x inspect] is just a place holder for the real
code. In the case of a new browser, it has been replaced for [
UbakyeBrowser new openFromFile]. Now I would like to access to the
message "saveToFile" which is defined on the UbakyeBrowser-UI, but this
is different from the "Open/Load" option menu, because I'm not creating
a new browser with an existing file name as parameter, but saving the
current tree in the browser, so this doesn't seems a message to be send
to the current GLMTreePresentation tree, but to the current browser
which contains that tree (the one that was defined with "buildBrowser"
above) and that object doesn't understand the saveToFile message,
because it was defined for the UbakyeBrowser class.
So, there is any way to send messages from the a Glamorous tree to the
current instance of the UbakyeBrowser which is being displayed on the
interface and contains that tree?
As usual, I don't know if I made myself clear, but if there is any way
to make better questions, please let me know also about it.
Cheers,
Offray
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev