Re: [Pharo-users] Spec: Capturing changes in a text morph

2016-07-27 Thread Offray Vladimir Luna Cárdenas
Thanks Johan, now I'm in the right path. I have implemented basic 
persistence and now I'm working on the add/remove promote/demote node 
operations and I need to revisit the body persistence after that to make 
it work on each node.


Cheers,

Offray


On 26/07/16 15:32, Johan Fabry wrote:

No, this is not in initializePresenter, since this is called only once, when 
the window is opened. Instead, you need to do this every time that the widget 
is changed. So in your code where you change the widget to a new one, I guess 
this is changeBody: , you need to configure this new widget.

--
Does this mail seem too brief? Sorry for that, I don’t mean to be rude! Please 
see http://emailcharter.org .

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile


On Jul 26, 2016, at 16:08, Offray Vladimir Luna Cárdenas 
 wrote:

Thanks Johan for your quick answer.

Your hypothesis is right and the contents of (4) are cleaned by a new widget 
when I click at the tree (2). I'm looking at my code and documentation, but I 
can't find properly how to implement your recommendation. I imagine is 
somewhere in initializePresenter, but I can't find the place... sorry I would 
like to be more helpful on getting help... :-/.

Any hint of how this code should look like and where it goes? "body whenTextChanged: 
aBlock" on initializePresenter seems doing nothing.

Cheers,

Offray


On 26/07/16 11:19, Johan Fabry wrote:

I think the problem is that when you click on an item in the tree (2), the 
contents of (4) is changed to a new widget. As a result the configuration that 
you did in initializePresenter is lost. What you should do is when you change 
the contents of (4) also configure this new widget with a whenTextChanged: 
block. I think that will solve your problem.

--
Does this mail seem too brief? Sorry for that, I don’t mean to be rude! Please 
see http://emailcharter.org .

Johan Fabry   -   http://pleiad.cl/~jfabry
PLEIAD and RyCh labs  -  Computer Science Department (DCC)  -  University of 
Chile


On Jul 25, 2016, at 18:12, Offray Vladimir Luna Cárdenas 
 wrote:

Hi,

I'm migrating my grafoscopio interface from I'm trying to capture some changes 
in a text morph that is part of a Spec interface. The interface is split in 4 
parts, as you can see at [a]: (1) a main menu, (2) a tree, (3) a node header 
input text and (4) a text morph. When you click any node on the tree (2) the 
name of the node, called the header is shown in (3) and the node contents, 
called the body are shown at (4). If you made a change in the header (pressing 
enter) it's reflected back to the main tree. And the node's body is changed for 
a text morph [b] or a and embedded playground [c] according to tags in the 
node. So the reading part is working and I have some partial support for 
persistence, at least for node headers.

[a] https://offray.withknown.com/2016/grafoscopio-notebook-interface
[b] https://offray.withknown.com/2016/grafoscopio-text-node
[c] https://offray.withknown.com/2016/grafoscopio-code-node

Now I would like to extend the persistence for node's body content, so when any 
changes happens in the (4) panel, be it a text panel or a playground, it is 
stored in a similar way to what is happening with node headers and the (3) 
panel, but I'm unsuccessful trying to capture those changes.

My initializeWidgets and initializePresenter are implemented this way:

=

GrafoscopioNotebook>>initializeWidgets

windowMainMenu := self newWindowMainMenu.
tree := TreeModel new.
body := self newText.
header := self newTextInput.

body disable.
body text: '<-- Select a node in the left panel'.

tree
childrenBlock: [:node | node children];
displayBlock: [:node | node title ].

=

initializePresenter

tree whenSelectedItemsChanged: [ :arg |
arg isEmpty ifFalse: [self changeBody: arg ]].
header whenTextChanged: [ :arg |
Transcript show: arg.
(tree selectedItem content header) = arg
ifFalse: [
(tree selectedItem) content header: arg.
tree roots: tree roots]].
body whenTextIsAccepted: [ :arg |
Transcript show: arg
]

=

I'm capturing properly the changes in text with whenTextChanged on the header 
but using the same message on body or whenTextIsAccepted doesn't produce any 
change on the trascript, and of course I can't update the any tree/node 
contents properly.

Any advice on how to solve this will be greatly appreciated. If can happen soon 
in this week even better, because we could show this to our hackathon/workshop 
attendees.

Cheers,

Offray
















Re: [Pharo-users] How can I save a project on GitHub to SmalltalkHub?

2016-07-27 Thread Thierry Goubier

Le 27/07/2016 à 23:42, Esteban Lorenzano a écrit :

Hi,

- first, there is a high change people already have git installed in their 
machines.


Hum. Do they need to have a ssh key registered on github to use 
ssh-based urls? GitFileTree (and Iceberg?) tend to focus on ssh urls, 
even if gitfiletree has support for https urls (but they are a bit 
harder to write).



- but anyway, people does not have to install git to load a project, metacello 
will download a zip and install from there, no clone and no anything needed.


The equivalence is, given a gitfiletree url of:

gitfiletree://github.com/User/Project:Branch/OptionalDirectory

the github:// url for Metacello will be:

github://User/Project:Branch/OptionalDirectory

and github:// can target tags or commits as well as branches.

Thierry


- and you can also prepare ConfigurationOf that points to tags/commits/branchs 
from git, so you can do your versions “Yuriy style”, pointing to them…





finally, if you want a mirror you can do a script more or less like this one:

git clone blah dir
curl get.pharo.org | bash
./pharo Pharo.image eval “
| packages gofer |

packages := #('FFI-Pools' 'SharedPool-Speech' 'Balloon-Engine-Pools' 'Sound' 
'Alien-Core' 'VMMaker-oscog' 'VMMaker.oscog' 'Cog' 'Qwaq-VMProfiling-Plugins' 
'VMConstruction-Plugins-AioPlugin' 
'VMConstruction-Plugins-OSProcessPlugin.oscog' 'Freetype-Plugin' 
'SqueakSSL-Plugin' 'ObjectiveC-Plugin' 'Applescript-Core' 'CMakeVMMaker' 
'PharoVMMaker').

gofer := Gofer it
url: 'filetree://dir/mc';
yourself.
packages do: [ :packageName |  gofer package: packageName ].
gofer fetch.
gofer := Gofer it
url: 'http://smalltalkhub.com/mc/Pharo/PharoVM/main' username: 
'PharoMirrorJob' password: ’shhh';
yourself.
packages do: [ :packageName |  gofer package: packageName ].
gofer push.
“

and you can run it in a cron :)

cheers,
Esteban


On 27 Jul 2016, at 23:26, Juraj Kubelka  wrote:

Hi,

How can I save (from time to time) project packages hosted on GitHub to 
SmalltakHub?

The reason is that I do not want to force people to install GIT when they want 
to install a project.
So I am thinking to regularly deploy it on SmalltalkHub and update 
ConfigurationOf.

Thanks in advance,
Juraj









Re: [Pharo-users] How can I save a project on GitHub to SmalltalkHub?

2016-07-27 Thread Esteban Lorenzano
Hi,

- first, there is a high change people already have git installed in their 
machines. 
- but anyway, people does not have to install git to load a project, metacello 
will download a zip and install from there, no clone and no anything needed. 
- and you can also prepare ConfigurationOf that points to tags/commits/branchs 
from git, so you can do your versions “Yuriy style”, pointing to them… 

finally, if you want a mirror you can do a script more or less like this one: 

git clone blah dir
curl get.pharo.org | bash
./pharo Pharo.image eval “
| packages gofer |

packages := #('FFI-Pools' 'SharedPool-Speech' 'Balloon-Engine-Pools' 'Sound' 
'Alien-Core' 'VMMaker-oscog' 'VMMaker.oscog' 'Cog' 'Qwaq-VMProfiling-Plugins' 
'VMConstruction-Plugins-AioPlugin' 
'VMConstruction-Plugins-OSProcessPlugin.oscog' 'Freetype-Plugin' 
'SqueakSSL-Plugin' 'ObjectiveC-Plugin' 'Applescript-Core' 'CMakeVMMaker' 
'PharoVMMaker').

gofer := Gofer it
url: 'filetree://dir/mc';
yourself.
packages do: [ :packageName |  gofer package: packageName ].
gofer fetch. 
gofer := Gofer it
url: 'http://smalltalkhub.com/mc/Pharo/PharoVM/main' username: 
'PharoMirrorJob' password: ’shhh';
yourself.
packages do: [ :packageName |  gofer package: packageName ].
gofer push.
“

and you can run it in a cron :)

cheers, 
Esteban

> On 27 Jul 2016, at 23:26, Juraj Kubelka  wrote:
> 
> Hi,
> 
> How can I save (from time to time) project packages hosted on GitHub to 
> SmalltakHub?
> 
> The reason is that I do not want to force people to install GIT when they 
> want to install a project.
> So I am thinking to regularly deploy it on SmalltalkHub and update 
> ConfigurationOf.
> 
> Thanks in advance,
> Juraj




[Pharo-users] How can I save a project on GitHub to SmalltalkHub?

2016-07-27 Thread Juraj Kubelka
Hi,

How can I save (from time to time) project packages hosted on GitHub to 
SmalltakHub?

The reason is that I do not want to force people to install GIT when they want 
to install a project.
So I am thinking to regularly deploy it on SmalltalkHub and update 
ConfigurationOf.

Thanks in advance,
Juraj


[Pharo-users] "self problem" with Ghost (virus)

2016-07-27 Thread Steven Costiou
Hi, 

I use virus from Ghost to intercept messages sent to a given object and
adapt methods behaviors for this particular object only. However it
would seems that doing interception this way is subject to the "self
problem" described in this paper from Stéphane (DUCASSE, Stéphane.
Evaluating message passing control techniques in Smalltalk. _JOURNAL OF
OBJECT ORIENTED PROGRAMMING_, 1999, vol. 12, p. 39-50). 

I understand i could do instance based adaptation using an other
technique, but i wonder if there is any way with Ghost to deal with this
"self problem" problem ? 

Steven.