Hi Doru,
On 09/14/2014 11:52 PM, Tudor Girba wrote:
Hi,
On Sun, Sep 14, 2014 at 10:45 PM, Offray Vladimir Luna Cárdenas
<offray(a)riseup.net <mailto:offray@riseup.net>> wrote:
[...]
The main conceptual issue I have is that most of the examples I see on the
Deep into Pharo and Moose Books on custom browsers are mapping the flow of
information in transmissions in one sense from general to particular:
packages to classes -> to protocols -> to methods -> to code editor,
This is incorrect. Transmissions handle any data between any ports.
Nice to know. What I'm pointing is that documentation only shows flux
from general to particular and not the other way around.
[...]
You do not send messages. You send data from one port to another, and
presentations react to the changes of port values from the panes in which they
reside. The outside port is just another port in the surrounding pane. You can
choose any port for any pane you want.
Thanks for the explanation. I understand it better.
[...]
For text being updated, you have this. The port is called #text.
Here is an updated example of how to store the text as it is being written by
using the block of a transmission:
objectStoringTheText := ''.
tabulator := GLMTabulator new.
tabulator column: #pane.
tabulator transmit
to: #pane;
andShow: [ :a | a text ].
tabulator transmit
from: #pane port: #text;
to: #pane port: #portIDoNotCareAbout;
transformed: [ :textComingFromThePresentation | objectStoringTheText :=
textComingFromThePresentation ].
tabulator openOn: text
In this case, objectStoringTheText is the object with which you can do what you
want. In this case, in the transformed: block, I simply store the text in it as
an example.
To test this example, just execute the code in a Moose image, then type
something, and then inspect objectStoringTheText. You will see that it has the
text that you typed.
Is this clearer now?
Cheers,
Doru
Yes, is clearer. I would like to start with kind of a most basic
browser, to send information back and forward.
Consider this:
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
| browser dict |
dict := Dictionary new.
dict at: 1 put: 'uno'.
dict at: 2 put: 'dos'.
browser := GLMTabulator new
title: 'Minimal test'.
browser column: #keys; column: #values.
browser transmit
to: #keys;
andShow: [:k | k list display: #keys ].
browser transmit
from: #keys;
to: #values;
andShow: [:v | v text display: #value ].
browser openOn: dict
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Now I have a two panes browser trying to show pairs in a dictionary. In
fact, I said "trying" because I get the key twice. So my questions
starting from there are:
1. How to show in the #values column the values of the dict once you
have selected the specific key in the #keys column?
2. How to get any update in the #values column as an updated value in
the dictionary using ports and transformed messages.
Thanks,
Offray