Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-18 Thread Franck Warlouzet
Ok I was not looking the solution in Nautilus, but in Rubric ...

Thanks a lot ! My eyes are alive again 

Franck

To: pharo-dev@lists.pharo.org
From: pharo-dev@lists.pharo.org
CC: alain.plan...@yahoo.com
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
Date: Mon, 18 May 2015 07:38:15 -0700



--Pièce jointe du message transmise--
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
From: alain.plan...@yahoo.com
Date: Mon, 18 May 2015 16:37:59 +0200
To: pharo-dev@lists.pharo.org

also send #withCodeSizeFeedback to have almost the same look as with 
PluggableTextMorph.
AbstractNautilusUI >>buildNewSourceTextArea
sourceTextArea := self textMorphClass   on: 
selftext: #sourceCodeFrom:  
accept: #compileSource:notifying:   
readSelection: #contentsSelectionFrom:  menu: 
#sourceCodeMenu:shifted:. sourceTextArea
  askBeforeDiscardingEdits: true; beForSmalltalkCode; 
withLineNumbers;withCodeSizeFeedback;  <  here ==   
beWrapped;  vResizing: #spaceFill;  hResizing: 
#spaceFill;  font: StandardFonts codeFont;   spaceFillWeight: 
3; on: #keyStroke send: #keyStroke:fromSourceCodeMorph: to: self.  
self setSourceCodeShorcutsTo: sourceTextArea.   ^ sourceTextArea 
Alain


On 18 May 2015, at 16:17, Alain Plantec  wrote:Hello 
Franck,
just changed  shoutAboutToStyle: as 
follow:AbstractNautilusUI>>shoutAboutToStyle: aPluggableShoutMorphOrView
“The comments are not styled"   ^ aPluggableShoutMorphOrView ~= commentTextArea 
and it seems to work.
Now, pay attention that, with Rubric, this is the editing mode that is passed 
as argument (for aPluggableShoutMorphOrView).  Here, a RubSmalltalkCodeMode. 
if you plan to use a Rubric also for the comments, then, normally 
shoutAboutToStyle: will not be sent because I guess a RubPlainTextMode will be 
used for the comment pane. This mode do not use shout.In that case the final 
version should be:
AbstractNautilusUI>>shoutAboutToStyle: aPluggableShoutMorphOrView   
^  true

CheersAlain

On 18 May 2015, at 14:41, Franck Warlouzet  
wrote:Hi,

With Alain's last commit of Rubric (205) we made a few changes to put Rubric in 
Nautilus. You can see thoses changes in the attached file.
As you can see there is no colors in the browser... Is 
RubScrolledTextMorph>>beForSmalltalkCode the good option ? I thought there 
would be just an option like aboutToStyle: true or something like that but 
there is not. I do not know if I missed something obvious or if I have to add 
the connection to RubShoutStylerDecorator. Any idea everyone ?
I am losing my eyes with uncolored code but I guess it is worth it.

Thanks,

Franck


To: pharo-dev@lists.pharo.org
From: pharo-dev@lists.pharo.org
CC: alain.plan...@yahoo.com
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
Date: Thu, 14 May 2015 05:16:30 -0700



--Pièce jointe du message transmise--
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
From: alain.plan...@yahoo.com
Date: Thu, 14 May 2015 14:16:16 +0200
To: pharo-dev@lists.pharo.org

done & committedCheersAlain
On 14 May 2015, at 12:06, Alain Plantec  wrote:ahh, 
good remark :)the menu stuff is not finished.I do it nowthanks Alain
On 13 May 2015, at 18:09, Franck Warlouzet  
wrote:Hi alain 

thanks a lot!
This helps us a lot. We got nearly something working. We will produce a list of 
methods and changes we had to do.
see in the attached cs.

Now

lookupMenu
"default implementation of the algorithm that lookup the menu"

| default |
default := [ self editingMode menu ].
^ self model 
ifNil: [ default value ] 
ifNotNil: [ :m | m menu ifNil: [ default value ] ]

We add a new method in nautilus that creates a menu as follow
because m is our NautilusModel

menu
^ self sourceCodeMenu: MenuMorph new shifted: false.

But I was wondering why m menu does not take into account the information we 
passed when we created the rubPluggable

sourceTextArea := self textMorphClass
on: self
text: #sourceCodeFrom:
accept: #compileSource:notifying:
readSelection: #contentsSelectionFrom:
menu: #sourceCodeMenu:shifted:.

I see that 
RubEditingArea has a policy but we could find how we can improve RubPluggable 
to use the menu:




To: pharo-dev@lists.pharo.org
From: pharo-dev@lists.pharo.org
CC: alain.plan...@yahoo.com
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
Date: Wed, 13 May 2015 07:26:15 -0700



--Pièce jointe du message transmise--
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
From: alain.plan...@yahoo.com
Date: Wed, 13 May 2015 16:25:34 +0200
To: pharo-dev@lists.p

Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-18 Thread Alain Plantec via Pharo-dev
--- Begin Message ---
Hello Franck,

just changed  shoutAboutToStyle: as follow:
AbstractNautilusUI>>shoutAboutToStyle: aPluggableShoutMorphOrView 
“The comments are not styled"
^ aPluggableShoutMorphOrView ~= commentTextArea 

and it seems to work.

Now, pay attention that, with Rubric, this is the editing mode that is passed 
as argument (for aPluggableShoutMorphOrView).  Here, a RubSmalltalkCodeMode. 

if you plan to use a Rubric also for the comments, then, normally 
shoutAboutToStyle: will not be sent because I guess a RubPlainTextMode will be 
used for the comment pane. This mode do not use shout.
In that case the final version should be:

AbstractNautilusUI>>shoutAboutToStyle: aPluggableShoutMorphOrView   
^  true


Cheers
Alain


> On 18 May 2015, at 14:41, Franck Warlouzet  
> wrote:
> 
> Hi,
> 
> With Alain's last commit of Rubric (205) we made a few changes to put Rubric 
> in Nautilus. You can see thoses changes in the attached file.
> As you can see there is no colors in the browser... Is 
> RubScrolledTextMorph>>beForSmalltalkCode the good option ? I thought there 
> would be just an option like aboutToStyle: true or something like that but 
> there is not. I do not know if I missed something obvious or if I have to add 
> the connection to RubShoutStylerDecorator. Any idea everyone ?
> I am losing my eyes with uncolored code but I guess it is worth it.
> 
> Thanks,
> 
> Franck
> 
> 
> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> From: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> CC: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus ....
> Date: Thu, 14 May 2015 05:16:30 -0700
> 
> 
> 
> --Pièce jointe du message transmise--
> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
> From: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
> Date: Thu, 14 May 2015 14:16:16 +0200
> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> 
> done & committed
> Cheers
> Alain
> On 14 May 2015, at 12:06, Alain Plantec  <mailto:alain.plan...@yahoo.com>> wrote:
> 
> ahh, good remark :)
> the menu stuff is not finished.
> I do it now
> thanks 
> Alain
> 
> On 13 May 2015, at 18:09, Franck Warlouzet  <mailto:franck.warlou...@hotmail.fr>> wrote:
> 
> Hi alain 
> 
> thanks a lot!
> This helps us a lot. We got nearly something working. We will produce a list 
> of methods and changes we had to do.
> see in the attached cs.
> 
> Now
> 
> lookupMenu
> "default implementation of the algorithm that lookup the menu"
> 
> | default |
> default := [ self editingMode menu ].
> ^ self model 
> ifNil: [ default value ] 
> ifNotNil: [ :m | m menu ifNil: [ default value ] ]
> 
> We add a new method in nautilus that creates a menu as follow
> because m is our NautilusModel
> 
> menu
> ^ self sourceCodeMenu: MenuMorph new shifted: false.
> 
> But I was wondering why m menu does not take into account the information we 
> passed when we created the rubPluggable
> 
> sourceTextArea := self textMorphClass
> on: self
> text: #sourceCodeFrom:
> accept: #compileSource:notifying:
> readSelection: #contentsSelectionFrom:
> menu: #sourceCodeMenu:shifted:.
> 
> I see that 
> RubEditingArea has a policy but we could find how we can improve RubPluggable 
> to use the menu:
> 
> 
> 
> 
> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> From: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> CC: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
> Date: Wed, 13 May 2015 07:26:15 -0700
> 
> 
> 
> --Pièce jointe du message transmise--
> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
> From: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
> Date: Wed, 13 May 2015 16:25:34 +0200
> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> 
> see Rubric-AlainPlantec.196 in the Rubric repo.
> 
> I’ve added RubPluggableTextMorph and RubPluggableTextMorphExample.
> Need to be polished certainly but it should facilitate the integration of 
> Rubric in Nautilus.
> 
> cheers
> Alain
> 
> On 12 May 2015, at 22:45, stepharo  <mailto:steph...@free.fr>> wrote:
> 
> For fun I put the following trace in 
> 
> sourceCodeFrom: aTextMorph
> Transcript show: '.'.

Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-18 Thread Alain Plantec via Pharo-dev
--- Begin Message ---
also send #withCodeSizeFeedback to have almost the same look as with 
PluggableTextMorph.

AbstractNautilusUI >>buildNewSourceTextArea

sourceTextArea := self textMorphClass
on: self
text: #sourceCodeFrom:
accept: #compileSource:notifying:
readSelection: #contentsSelectionFrom:
menu: #sourceCodeMenu:shifted:.

sourceTextArea
askBeforeDiscardingEdits: true;
beForSmalltalkCode;
withLineNumbers; 
withCodeSizeFeedback;  <  here ==
beWrapped;
vResizing: #spaceFill;
hResizing: #spaceFill; 
font: StandardFonts codeFont;
spaceFillWeight: 3;
on: #keyStroke send: #keyStroke:fromSourceCodeMorph: to: self.
self setSourceCodeShorcutsTo: sourceTextArea.
^ sourceTextArea 

Alain



> On 18 May 2015, at 16:17, Alain Plantec  wrote:
> 
> Hello Franck,
> 
> just changed  shoutAboutToStyle: as follow:
> AbstractNautilusUI>>shoutAboutToStyle: aPluggableShoutMorphOrView 
>   “The comments are not styled"
>   ^ aPluggableShoutMorphOrView ~= commentTextArea 
> 
> and it seems to work.
> 
> Now, pay attention that, with Rubric, this is the editing mode that is passed 
> as argument (for aPluggableShoutMorphOrView).  Here, a RubSmalltalkCodeMode. 
> 
> if you plan to use a Rubric also for the comments, then, normally 
> shoutAboutToStyle: will not be sent because I guess a RubPlainTextMode will 
> be used for the comment pane. This mode do not use shout.
> In that case the final version should be:
> 
> AbstractNautilusUI>>shoutAboutToStyle: aPluggableShoutMorphOrView 
>   ^  true
> 
> 
> Cheers
> Alain
> 
> 
>> On 18 May 2015, at 14:41, Franck Warlouzet > <mailto:franck.warlou...@hotmail.fr>> wrote:
>> 
>> Hi,
>> 
>> With Alain's last commit of Rubric (205) we made a few changes to put Rubric 
>> in Nautilus. You can see thoses changes in the attached file.
>> As you can see there is no colors in the browser... Is 
>> RubScrolledTextMorph>>beForSmalltalkCode the good option ? I thought there 
>> would be just an option like aboutToStyle: true or something like that but 
>> there is not. I do not know if I missed something obvious or if I have to 
>> add the connection to RubShoutStylerDecorator. Any idea everyone ?
>> I am losing my eyes with uncolored code but I guess it is worth it.
>> 
>> Thanks,
>> 
>> Franck
>> 
>> 
>> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
>> From: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
>> CC: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
>> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
>> Date: Thu, 14 May 2015 05:16:30 -0700
>> 
>> 
>> 
>> --Pièce jointe du message transmise--
>> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
>> From: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
>> Date: Thu, 14 May 2015 14:16:16 +0200
>> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
>> 
>> done & committed
>> Cheers
>> Alain
>> On 14 May 2015, at 12:06, Alain Plantec > <mailto:alain.plan...@yahoo.com>> wrote:
>> 
>> ahh, good remark :)
>> the menu stuff is not finished.
>> I do it now
>> thanks 
>> Alain
>> 
>> On 13 May 2015, at 18:09, Franck Warlouzet > <mailto:franck.warlou...@hotmail.fr>> wrote:
>> 
>> Hi alain 
>> 
>> thanks a lot!
>> This helps us a lot. We got nearly something working. We will produce a list 
>> of methods and changes we had to do.
>> see in the attached cs.
>> 
>> Now
>> 
>> lookupMenu
>> "default implementation of the algorithm that lookup the menu"
>> 
>> | default |
>> default := [ self editingMode menu ].
>> ^ self model 
>> ifNil: [ default value ] 
>> ifNotNil: [ :m | m menu ifNil: [ default value ] ]
>> 
>> We add a new method in nautilus that creates a menu as follow
>> because m is our NautilusModel
>> 
>> menu
>> ^ self sourceCodeMenu: MenuMorph new shifted: false.
>> 
>> But I was wondering why m menu does not take into account the information we 
>> passed when we created the rubPluggable
>&g

Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-18 Thread Franck Warlouzet
Hi,

With Alain's last commit of Rubric (205) we made a few changes to put Rubric in 
Nautilus. You can see thoses changes in the attached file.
As you can see there is no colors in the browser... Is 
RubScrolledTextMorph>>beForSmalltalkCode the good option ? I thought there 
would be just an option like aboutToStyle: true or something like that but 
there is not. I do not know if I missed something obvious or if I have to add 
the connection to RubShoutStylerDecorator. Any idea everyone ?
I am losing my eyes with uncolored code but I guess it is worth it.

Thanks,

Franck


To: pharo-dev@lists.pharo.org
From: pharo-dev@lists.pharo.org
CC: alain.plan...@yahoo.com
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
Date: Thu, 14 May 2015 05:16:30 -0700



--Pièce jointe du message transmise--
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
From: alain.plan...@yahoo.com
Date: Thu, 14 May 2015 14:16:16 +0200
To: pharo-dev@lists.pharo.org

done & committedCheersAlain
On 14 May 2015, at 12:06, Alain Plantec  wrote:ahh, 
good remark :)the menu stuff is not finished.I do it nowthanks Alain
On 13 May 2015, at 18:09, Franck Warlouzet  
wrote:Hi alain 

thanks a lot!
This helps us a lot. We got nearly something working. We will produce a list of 
methods and changes we had to do.
see in the attached cs.

Now

lookupMenu
"default implementation of the algorithm that lookup the menu"

| default |
default := [ self editingMode menu ].
^ self model 
ifNil: [ default value ] 
ifNotNil: [ :m | m menu ifNil: [ default value ] ]

We add a new method in nautilus that creates a menu as follow
because m is our NautilusModel

menu
^ self sourceCodeMenu: MenuMorph new shifted: false.

But I was wondering why m menu does not take into account the information we 
passed when we created the rubPluggable

sourceTextArea := self textMorphClass
on: self
text: #sourceCodeFrom:
accept: #compileSource:notifying:
readSelection: #contentsSelectionFrom:
menu: #sourceCodeMenu:shifted:.

I see that 
RubEditingArea has a policy but we could find how we can improve RubPluggable 
to use the menu:




To: pharo-dev@lists.pharo.org
From: pharo-dev@lists.pharo.org
CC: alain.plan...@yahoo.com
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
Date: Wed, 13 May 2015 07:26:15 -0700



--Pièce jointe du message transmise--
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
From: alain.plan...@yahoo.com
Date: Wed, 13 May 2015 16:25:34 +0200
To: pharo-dev@lists.pharo.org

see Rubric-AlainPlantec.196 in the Rubric repo.
I’ve added RubPluggableTextMorph and RubPluggableTextMorphExample.Need to be 
polished certainly but it should facilitate the integration of Rubric in 
Nautilus.
cheersAlain
On 12 May 2015, at 22:45, stepharo  wrote:For fun I put the 
following trace in sourceCodeFrom: aTextMorphTranscript show: '.'.^ 
self sourceCodeAnd in general this method is invoked three times instead of one 
:)
Before asking we read all the examples and I saw that selector: is used to 
communicate and update the code pane.

(UIManager default newAutoAcceptTextEntryFor: self
get: #selector
set: #selector:
class: String
getEnabled: #haveClassName
help: 'Enter a selector' translated
entryCompletion: entryCompletion)
acceptOnCR: false;
ghostText: 'Selector';
withDropListButton;


I think this is only for the drop down list.
What I meant is that I could use set: and pass the selector to be invoked by 
the dropdown when the drop down is selected. And it will notify self with the 
selector: selector. So we could sepcify any selector (ie I can register to the 
drop box and say call me once you are set). In 
RubMethodEditingExample>>#selector:
it calls the update explicit
 self updateCodeWith:  (cls sourceCodeAt: selector)
and updateCodeWith: sets the text on the text model.



 Now my problem (and may be there is not solution) is how can I connect from a 
pluggableListMorph to a RubScrollText
when the list does not generate announcement.
This is why I tried to pass via dependents or something like that.

I will try to generate announcements but this is a lot more work and I do not 
know if it will work.

Stef





  

Unnamed.cs
Description: Binary data


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-14 Thread stepharo

thanks Alain
You rock :)

When you visit us I would love to see if we could brainstorm on changs 
in Nautilus to remove the need for RubPluggable :)
I would like to remove PluggableTextWithLimits and I would love also to 
deprecate TextMorph.


Stef



Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-14 Thread Alain Plantec via Pharo-dev
--- Begin Message ---
done & committed
Cheers
Alain
> On 14 May 2015, at 12:06, Alain Plantec  wrote:
> 
> ahh, good remark :)
> the menu stuff is not finished.
> I do it now
> thanks 
> Alain
> 
>> On 13 May 2015, at 18:09, Franck Warlouzet > <mailto:franck.warlou...@hotmail.fr>> wrote:
>> 
>> Hi alain 
>> 
>> thanks a lot!
>> This helps us a lot. We got nearly something working. We will produce a list 
>> of methods and changes we had to do.
>> see in the attached cs.
>> 
>> Now
>> 
>> lookupMenu
>> "default implementation of the algorithm that lookup the menu"
>> 
>> | default |
>> default := [ self editingMode menu ].
>> ^ self model 
>> ifNil: [ default value ] 
>> ifNotNil: [ :m | m menu ifNil: [ default value ] ]
>> 
>> We add a new method in nautilus that creates a menu as follow
>> because m is our NautilusModel
>> 
>> menu
>> ^ self sourceCodeMenu: MenuMorph new shifted: false.
>> 
>> But I was wondering why m menu does not take into account the information we 
>> passed when we created the rubPluggable
>> 
>> sourceTextArea := self textMorphClass
>> on: self
>> text: #sourceCodeFrom:
>> accept: #compileSource:notifying:
>> readSelection: #contentsSelectionFrom:
>> menu: #sourceCodeMenu:shifted:.
>> 
>> I see that 
>> RubEditingArea has a policy but we could find how we can improve 
>> RubPluggable to use the menu:
>> 
>> 
>> 
>> 
>> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
>> From: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
>> CC: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
>> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
>> Date: Wed, 13 May 2015 07:26:15 -0700
>> 
>> 
>> 
>> --Pièce jointe du message transmise--
>> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
>> From: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
>> Date: Wed, 13 May 2015 16:25:34 +0200
>> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
>> 
>> see Rubric-AlainPlantec.196 in the Rubric repo.
>> 
>> I’ve added RubPluggableTextMorph and RubPluggableTextMorphExample.
>> Need to be polished certainly but it should facilitate the integration of 
>> Rubric in Nautilus.
>> 
>> cheers
>> Alain
>> 
>> On 12 May 2015, at 22:45, stepharo > <mailto:steph...@free.fr>> wrote:
>> 
>> For fun I put the following trace in 
>> 
>> sourceCodeFrom: aTextMorph
>> Transcript show: '.'.
>> ^ self sourceCode
>> 
>> And in general this method is invoked three times instead of one :)
>> 
>> 
>> 
>> Before asking we read all the examples and I saw that selector: is used to 
>> communicate and update the code pane.
>> 
>> (UIManager default newAutoAcceptTextEntryFor: self
>> get: #selector
>> set: #selector:
>> class: String
>> getEnabled: #haveClassName
>> help: 'Enter a selector' translated
>> entryCompletion: entryCompletion)
>> acceptOnCR: false;
>> ghostText: 'Selector';
>> withDropListButton;
>> 
>> 
>> I think this is only for the drop down list.
>> 
>> What I meant is that I could use set: and pass the selector to be invoked by 
>> the dropdown when the drop down is selected. 
>> And it will notify self with the selector: selector. So we could sepcify any 
>> selector (ie I can register to the drop box and say call me once you are 
>> set). 
>> 
>> 
>> In RubMethodEditingExample>>#selector:
>> it calls the update explicit
>>  self updateCodeWith:  (cls sourceCodeAt: selector)
>> and updateCodeWith: sets the text on the text model.
>> 
>> 
>> 
>>  
>> Now my problem (and may be there is not solution) is how can I connect from 
>> a pluggableListMorph to a RubScrollText
>> when the list does not generate announcement.
>> This is why I tried to pass via dependents or something like that.
>> 
>> I will try to generate announcements but this is a lot more work and I do 
>> not know if it will work.
>> 
>> Stef
>> 
>> 
>> 
>> 
>> 
>> 
> 

--- End Message ---


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-14 Thread Alain Plantec via Pharo-dev
--- Begin Message ---
ahh, good remark :)
the menu stuff is not finished.
I do it now
thanks 
Alain

> On 13 May 2015, at 18:09, Franck Warlouzet  
> wrote:
> 
> Hi alain 
> 
> thanks a lot!
> This helps us a lot. We got nearly something working. We will produce a list 
> of methods and changes we had to do.
> see in the attached cs.
> 
> Now
> 
> lookupMenu
> "default implementation of the algorithm that lookup the menu"
> 
> | default |
> default := [ self editingMode menu ].
> ^ self model 
> ifNil: [ default value ] 
> ifNotNil: [ :m | m menu ifNil: [ default value ] ]
> 
> We add a new method in nautilus that creates a menu as follow
> because m is our NautilusModel
> 
> menu
> ^ self sourceCodeMenu: MenuMorph new shifted: false.
> 
> But I was wondering why m menu does not take into account the information we 
> passed when we created the rubPluggable
> 
> sourceTextArea := self textMorphClass
> on: self
> text: #sourceCodeFrom:
> accept: #compileSource:notifying:
> readSelection: #contentsSelectionFrom:
> menu: #sourceCodeMenu:shifted:.
> 
> I see that 
> RubEditingArea has a policy but we could find how we can improve RubPluggable 
> to use the menu:
> 
> 
> 
> 
> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> From: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> CC: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
> Date: Wed, 13 May 2015 07:26:15 -0700
> 
> 
> 
> --Pièce jointe du message transmise--
> Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
> From: alain.plan...@yahoo.com <mailto:alain.plan...@yahoo.com>
> Date: Wed, 13 May 2015 16:25:34 +0200
> To: pharo-dev@lists.pharo.org <mailto:pharo-dev@lists.pharo.org>
> 
> see Rubric-AlainPlantec.196 in the Rubric repo.
> 
> I’ve added RubPluggableTextMorph and RubPluggableTextMorphExample.
> Need to be polished certainly but it should facilitate the integration of 
> Rubric in Nautilus.
> 
> cheers
> Alain
> 
> On 12 May 2015, at 22:45, stepharo  <mailto:steph...@free.fr>> wrote:
> 
> For fun I put the following trace in 
> 
> sourceCodeFrom: aTextMorph
> Transcript show: '.'.
> ^ self sourceCode
> 
> And in general this method is invoked three times instead of one :)
> 
> 
> 
> Before asking we read all the examples and I saw that selector: is used to 
> communicate and update the code pane.
> 
> (UIManager default newAutoAcceptTextEntryFor: self
> get: #selector
> set: #selector:
> class: String
> getEnabled: #haveClassName
> help: 'Enter a selector' translated
> entryCompletion: entryCompletion)
> acceptOnCR: false;
> ghostText: 'Selector';
> withDropListButton;
> 
> 
> I think this is only for the drop down list.
> 
> What I meant is that I could use set: and pass the selector to be invoked by 
> the dropdown when the drop down is selected. 
> And it will notify self with the selector: selector. So we could sepcify any 
> selector (ie I can register to the drop box and say call me once you are 
> set). 
> 
> 
> In RubMethodEditingExample>>#selector:
> it calls the update explicit
>  self updateCodeWith:  (cls sourceCodeAt: selector)
> and updateCodeWith: sets the text on the text model.
> 
> 
> 
>  
> Now my problem (and may be there is not solution) is how can I connect from a 
> pluggableListMorph to a RubScrollText
> when the list does not generate announcement.
> This is why I tried to pass via dependents or something like that.
> 
> I will try to generate announcements but this is a lot more work and I do not 
> know if it will work.
> 
> Stef
> 
> 
> 
> 
> 
> 

--- End Message ---


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-13 Thread Franck Warlouzet
Hi alain 

thanks a lot!
This helps us a lot. We got nearly something working. We will produce a list of 
methods and changes we had to do.
see in the attached cs.

Now

lookupMenu
"default implementation of the algorithm that lookup the menu"

| default |
default := [ self editingMode menu ].
^ self model 
ifNil: [ default value ] 
ifNotNil: [ :m | m menu ifNil: [ default value ] ]

We add a new method in nautilus that creates a menu as follow
because m is our NautilusModel

menu
^ self sourceCodeMenu: MenuMorph new shifted: false.

But I was wondering why m menu does not take into account the information we 
passed when we created the rubPluggable

sourceTextArea := self textMorphClass
on: self
text: #sourceCodeFrom:
accept: #compileSource:notifying:
readSelection: #contentsSelectionFrom:
menu: #sourceCodeMenu:shifted:.

I see that 
RubEditingArea has a policy but we could find how we can improve RubPluggable 
to use the menu:




To: pharo-dev@lists.pharo.org
From: pharo-dev@lists.pharo.org
CC: alain.plan...@yahoo.com
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
Date: Wed, 13 May 2015 07:26:15 -0700



--Pièce jointe du message transmise--
Subject: Re: [Pharo-dev] Trying to use Rubric in Nautilus 
From: alain.plan...@yahoo.com
Date: Wed, 13 May 2015 16:25:34 +0200
To: pharo-dev@lists.pharo.org

see Rubric-AlainPlantec.196 in the Rubric repo.
I’ve added RubPluggableTextMorph and RubPluggableTextMorphExample.Need to be 
polished certainly but it should facilitate the integration of Rubric in 
Nautilus.
cheersAlain
On 12 May 2015, at 22:45, stepharo  wrote:For fun I put the 
following trace in sourceCodeFrom: aTextMorphTranscript show: '.'.^ 
self sourceCodeAnd in general this method is invoked three times instead of one 
:)
Before asking we read all the examples and I saw that selector: is used to 
communicate and update the code pane.

(UIManager default newAutoAcceptTextEntryFor: self
get: #selector
set: #selector:
class: String
getEnabled: #haveClassName
help: 'Enter a selector' translated
entryCompletion: entryCompletion)
acceptOnCR: false;
ghostText: 'Selector';
withDropListButton;


I think this is only for the drop down list.
What I meant is that I could use set: and pass the selector to be invoked by 
the dropdown when the drop down is selected. And it will notify self with the 
selector: selector. So we could sepcify any selector (ie I can register to the 
drop box and say call me once you are set). In 
RubMethodEditingExample>>#selector:
it calls the update explicit
 self updateCodeWith:  (cls sourceCodeAt: selector)
and updateCodeWith: sets the text on the text model.



 Now my problem (and may be there is not solution) is how can I connect from a 
pluggableListMorph to a RubScrollText
when the list does not generate announcement.
This is why I tried to pass via dependents or something like that.

I will try to generate announcements but this is a lot more work and I do not 
know if it will work.

Stef



  

glueRubNautilus.2.cs
Description: Binary data


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-13 Thread Alain Plantec via Pharo-dev
--- Begin Message ---
see Rubric-AlainPlantec.196 in the Rubric repo.

I’ve added RubPluggableTextMorph and RubPluggableTextMorphExample.
Need to be polished certainly but it should facilitate the integration of 
Rubric in Nautilus.

cheers
Alain

> On 12 May 2015, at 22:45, stepharo  wrote:
> 
> For fun I put the following trace in 
> 
> sourceCodeFrom: aTextMorph
> Transcript show: '.'.
> ^ self sourceCode
> 
> And in general this method is invoked three times instead of one :)
> 
> 
>> 
>> Before asking we read all the examples and I saw that selector: is used to 
>> communicate and update the code pane.
>> 
>> (UIManager default newAutoAcceptTextEntryFor: self
>> get: #selector
>> set: #selector:
>> class: String
>> getEnabled: #haveClassName
>> help: 'Enter a selector' translated
>> entryCompletion: entryCompletion)
>> acceptOnCR: false;
>> ghostText: 'Selector';
>> withDropListButton;
>> 
>> 
>> I think this is only for the drop down list.
> 
> What I meant is that I could use set: and pass the selector to be invoked by 
> the dropdown when the drop down is selected. 
> And it will notify self with the selector: selector. So we could sepcify any 
> selector (ie I can register to the drop box and say call me once you are 
> set). 
> 
> 
>> In RubMethodEditingExample>>#selector:
>> it calls the update explicit
>>  self updateCodeWith:  (cls sourceCodeAt: selector)
>> and updateCodeWith: sets the text on the text model.
>> 
>> 
>> 
>>  
>> Now my problem (and may be there is not solution) is how can I connect from 
>> a pluggableListMorph to a RubScrollText
>> when the list does not generate announcement.
>> This is why I tried to pass via dependents or something like that.
>> 
>> I will try to generate announcements but this is a lot more work and I do 
>> not know if it will work.
>> 
>> Stef
>> 
>> 
> 
> 

--- End Message ---


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread stepharo

For fun I put the following trace in

sourceCodeFrom: aTextMorph
Transcript show: '.'.
^ self sourceCode

And in general this method is invoked three times instead of one :)




Before asking we read all the examples and I saw that selector: is
used to communicate and update the code pane.

(UIManager default newAutoAcceptTextEntryFor: self
get: #selector
set: #selector:
class: String
getEnabled: #haveClassName
help: 'Enter a selector' translated
entryCompletion: entryCompletion)
acceptOnCR: false;
ghostText: 'Selector';
withDropListButton;


I think this is only for the drop down list.


What I meant is that I could use set: and pass the selector to be 
invoked by the dropdown when the drop down is selected.
And it will notify self with the selector: selector. So we could sepcify 
any selector (ie I can register to the drop box and say call me once you 
are set).




In RubMethodEditingExample>>#selector:
it calls the update explicit
 self updateCodeWith:  (cls sourceCodeAt: selector)
and updateCodeWith: sets the text on the text model.



Now my problem (and may be there is not solution) is how can I
connect from a pluggableListMorph to a RubScrollText
when the list does not generate announcement.
This is why I tried to pass via dependents or something like that.

I will try to generate announcements but this is a lot more work
and I do not know if it will work.

Stef






Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread Nicolai Hess
2015-05-12 21:44 GMT+02:00 stepharo :

> Thanks alain
>
>
> Before asking we read all the examples and I saw that selector: is used to
> communicate and update the code pane.
>
> (UIManager default newAutoAcceptTextEntryFor: self
> get: #selector
> set: #selector:
> class: String
> getEnabled: #haveClassName
> help: 'Enter a selector' translated
> entryCompletion: entryCompletion)
> acceptOnCR: false;
> ghostText: 'Selector';
> withDropListButton;
>
>
I think this is only for the drop down list.
In RubMethodEditingExample>>#selector:
it calls the update explicit
 self updateCodeWith:  (cls sourceCodeAt: selector)
and updateCodeWith: sets the text on the text model.





> Now my problem (and may be there is not solution) is how can I connect
> from a pluggableListMorph to a RubScrollText
> when the list does not generate announcement.
> This is why I tried to pass via dependents or something like that.
>
> I will try to generate announcements but this is a lot more work and I do
> not know if it will work.
>
> Stef
>
>


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread Alain Plantec via Pharo-dev
--- Begin Message ---
Ok i see. It is possible to code an adapter with the pluggabletexmorph 
protocol. I will try to do it tomorrow. 

Cheers

Alain

De:"stepharo" 
Date:mar j mai PM à 21:44
Objet:Re: [Pharo-dev] Trying to use Rubric in Nautilus 

Thanks alain


Before asking we read all the examples and I saw that selector: is used 
to communicate and update the code pane.

(UIManager default newAutoAcceptTextEntryFor: self
            get: #selector
            set: #selector:
            class: String
            getEnabled: #haveClassName
            help: 'Enter a selector' translated
            entryCompletion: entryCompletion)
                acceptOnCR: false;
                ghostText: 'Selector';
                withDropListButton;

Now my problem (and may be there is not solution) is how can I connect 
from a pluggableListMorph to a RubScrollText
when the list does not generate announcement.
This is why I tried to pass via dependents or something like that.

I will try to generate announcements but this is a lot more work and I 
do not know if it will work.

Stef

--- End Message ---


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread Nicolai Hess
2015-05-12 21:40 GMT+02:00 stepharo :

>  But nicolai I know announcement. Now the widgets of Nautilus do not use
> announcement so I do not know if I
> can  simply replace self changed: #sourceCodeFrom:
> I do not know the implication of removing sourceCodeFrom:
>

OK, I just thought rubric uses announcement in place of self changed:
So, and now? Replace all self changed... with self sourceCodeArea setText ?


>
> Le 12/5/15 17:41, Nicolai Hess a écrit :
>
>  Announcements!
>
> replace
> self changed: #sourceCodeFrom:.
> with something like
> self announcer announce:RubTextSetInModel.
>
>  ( I am not sure what RubXXAnouncement to use)
>
>
>
>
>
> 2015-05-12 17:14 GMT+02:00 stepharo :
>
>> We tried all kind of combinations
>>
>>
>>  modelEditor := (RubSmalltalkMethodEditorModel new client: self).
>> widget := modelEditor newScrolledText.
>>
>>
>> widget
>> on: self
>> text: #sourceCodeFrom:
>> accept: #compileSource:notifying:
>> readSelection: #contentsSelectionFrom:
>> menu: #sourceCodeMenu:shifted:.
>>
>>  self addDependent: modelEditor.
>> self when: #sourceCodeFrom: send: #setText: to: modelEditor.
>>
>> widget
>> beWrapped;
>> beForSmalltalkCode;
>> withLineNumbers;
>> setText: self sourceCode;
>>  setTextSelector: #halt.
>> ^ widget
>>
>>
>> But we cannot get the editor or the widget to be invoked when the list
>> changes.
>> So we spent three hours on it so we should stop. We are missing just this
>> bit.
>>
>> Stef
>>
>>
>
>


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread stepharo

Thanks alain


Before asking we read all the examples and I saw that selector: is used 
to communicate and update the code pane.


(UIManager default newAutoAcceptTextEntryFor: self
get: #selector
set: #selector:
class: String
getEnabled: #haveClassName
help: 'Enter a selector' translated
entryCompletion: entryCompletion)
acceptOnCR: false;
ghostText: 'Selector';
withDropListButton;

Now my problem (and may be there is not solution) is how can I connect 
from a pluggableListMorph to a RubScrollText

when the list does not generate announcement.
This is why I tried to pass via dependents or something like that.

I will try to generate announcements but this is a lot more work and I 
do not know if it will work.


Stef



Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread stepharo
But nicolai I know announcement. Now the widgets of Nautilus do not use 
announcement so I do not know if I

can  simply replace self changed: #sourceCodeFrom:
I do not know the implication of removing sourceCodeFrom:

Le 12/5/15 17:41, Nicolai Hess a écrit :

Announcements!

replace
self changed: #sourceCodeFrom:.
with something like
self announcer announce:RubTextSetInModel.

( I am not sure what RubXXAnouncement to use)





2015-05-12 17:14 GMT+02:00 stepharo >:


We tried all kind of combinations


 modelEditor := (RubSmalltalkMethodEditorModel new client: self).
widget := modelEditor newScrolledText.


widget
on: self
text: #sourceCodeFrom:
accept: #compileSource:notifying:
readSelection: #contentsSelectionFrom:
menu: #sourceCodeMenu:shifted:.

self addDependent: modelEditor.
self when: #sourceCodeFrom: send: #setText: to: modelEditor.

widget
beWrapped;
beForSmalltalkCode;
withLineNumbers;
setText: self sourceCode;
setTextSelector: #halt.
^ widget


But we cannot get the editor or the widget to be invoked when the
list changes.
So we spent three hours on it so we should stop. We are missing
just this bit.

Stef






Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread stepharo

We tried

 modelEditor := (RubSmalltalkMethodEditorModel new client: self).
widget := modelEditor newScrolledText.

widget
on: self
text: #sourceCodeFrom:
accept: #compileSource:notifying:
readSelection: #contentsSelectionFrom:
menu: #sourceCodeMenu:shifted:.
self addDependent: modelEditor.
self when: #sourceCodeFrom: send: #setText: to: modelEditor.

widget
beWrapped;
beForSmalltalkCode;
withLineNumbers;
setText: self sourceCode;
setTextSelector: #halt.
^ widget




Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread Alain Plantec via Pharo-dev
--- Begin Message ---

Attached a simple example (RubTextStuff.st).
see the use of the RubTextAccepted announcement (RubTextStuff class>>example)
to do things when the code is accepted in the view.

now you can also have a look at RubMethodEditingExample

when the selector change, then the code in the text view is changed:

selector: aSymbol
selector := aSymbol ifNotNil: [:sel |( sel copyWithout: Character cr) 
asSymbol].
self updateCodeWith: ''.
self changed: #selector.
self classToUse 
ifNotNil: [:cls | (cls selectors includes: selector)
ifTrue: [self updateCodeWith:  (cls sourceCodeAt: 
selector)]]

updateCodeWith: someText.
self textModel setText: someText.

Cheers
Alain



> On 12 mai 2015, at 17:14, stepharo  wrote:
> 
> We tried all kind of combinations
> 
> 
> modelEditor := (RubSmalltalkMethodEditorModel new client: self).
>widget := modelEditor newScrolledText.
> 
> 
>widget
>on: self
>text: #sourceCodeFrom:
>accept: #compileSource:notifying:
>readSelection: #contentsSelectionFrom:
>menu: #sourceCodeMenu:shifted:.
> 
>self addDependent: modelEditor.
>self when: #sourceCodeFrom: send: #setText: to: modelEditor.
> 
>widget
>beWrapped;
>beForSmalltalkCode;
>withLineNumbers;
>setText: self sourceCode;
>setTextSelector: #halt.
>^ widget
> 
> 
> But we cannot get the editor or the widget to be invoked when the list 
> changes.
> So we spent three hours on it so we should stop. We are missing just this bit.
> 
> Stef
> 


RubricStuff.st
Description: Binary data
--- End Message ---


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread Nicolai Hess
Announcements!

replace
self changed: #sourceCodeFrom:.
with something like
self announcer announce:RubTextSetInModel.

( I am not sure what RubXXAnouncement to use)





2015-05-12 17:14 GMT+02:00 stepharo :

> We tried all kind of combinations
>
>
>  modelEditor := (RubSmalltalkMethodEditorModel new client: self).
> widget := modelEditor newScrolledText.
>
>
> widget
> on: self
> text: #sourceCodeFrom:
> accept: #compileSource:notifying:
> readSelection: #contentsSelectionFrom:
> menu: #sourceCodeMenu:shifted:.
>
> self addDependent: modelEditor.
> self when: #sourceCodeFrom: send: #setText: to: modelEditor.
>
> widget
> beWrapped;
> beForSmalltalkCode;
> withLineNumbers;
> setText: self sourceCode;
> setTextSelector: #halt.
> ^ widget
>
>
> But we cannot get the editor or the widget to be invoked when the list
> changes.
> So we spent three hours on it so we should stop. We are missing just this
> bit.
>
> Stef
>
>


Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread stepharo

We tried all kind of combinations


 modelEditor := (RubSmalltalkMethodEditorModel new client: self).
widget := modelEditor newScrolledText.


widget
on: self
text: #sourceCodeFrom:
accept: #compileSource:notifying:
readSelection: #contentsSelectionFrom:
menu: #sourceCodeMenu:shifted:.

self addDependent: modelEditor.
self when: #sourceCodeFrom: send: #setText: to: modelEditor.

widget
beWrapped;
beForSmalltalkCode;
withLineNumbers;
setText: self sourceCode;
setTextSelector: #halt.
^ widget


But we cannot get the editor or the widget to be invoked when the list 
changes.
So we spent three hours on it so we should stop. We are missing just 
this bit.


Stef



Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread stepharo

Ok we looked at it a lot :)
But what is missing to use is how we can register the morph to the 
nautilus list so that when it changes we get invoked.

In Nautilus this is self changed: #sourceCodeFrom:

We tried to register via addDependent. but it did not work.
We will look again at

RubSmalltalkMethodEditorModel

But we need to declare how itget notified when the browser list changes too.


Le 12/5/15 17:02, Alain Plantec via Pharo-dev a écrit :




Re: [Pharo-dev] Trying to use Rubric in Nautilus ....

2015-05-12 Thread Alain Plantec via Pharo-dev
--- Begin Message ---
Maybe you should use RubSmalltalkMethodEditorModel
(one have also RubSmalltalkScriptEditorModel).

Have a look at RubWorkspaceExample to see how it can be used.

Alain

> On 12 mai 2015, at 16:40, stepharo  wrote:
> 
> Hi
> 
> we are trying with Franck Warlouzet to use Rubric in Nautilus
> and we saw that getMenuSelector is missing.
> 
> on: aModel text: aGetTextSelector accept: aSetTextSelector readSelection: 
> aReadSelectionSelector menu: aGetMenuSelector
>self getTextSelector: aGetTextSelector.
>self setTextSelector: aSetTextSelector.
>self getSelectionSelector: aReadSelectionSelector.
>"self getMenuSelector: aGetMenuSelector."
>self on: aModel
> 
> 
> Alain
> 
> we are trying to adapt
> 
> buildCodePane
> 
>sourceTextArea := self textMorphClass
>on: self
>text: #sourceCodeFrom:
>accept: #compileSource:notifying:
>readSelection: #contentsSelectionFrom:
>menu: #sourceCodeMenu:shifted:.
> 
>sourceTextArea
>askBeforeDiscardingEdits: true;
>vResizing: #spaceFill;
>hResizing: #spaceFill;
>font: StandardFonts codeFont;
>spaceFillWeight: 3;
>on: #keyStroke send: #keyStroke:fromSourceCodeMorph: to: self.
> 
>self setSourceCodeShorcutsTo: sourceTextArea.
>^ sourceTextArea
> 
> to use Rubric
> 
> buildCodePane
> 
>widget := RubScrolledTextMorph new.
>widget
>on: self
>text: #sourceCodeFrom:
>accept: #compileSource:notifying:
>readSelection: #contentsSelectionFrom:
>menu: #sourceCodeMenu:shifted:.
>widget
>beWrapped;
>beForSmalltalkCode;
>withLineNumbers;
>setText: self sourceCode;
>getTextSelector: #halt.
>^ widget
> 
> 
> And now we do not get how the widget can be notified when a new method is 
> selected.
> 
> Alain :)
> 
> 


--- End Message ---