Hi,

> On Jul 14, 2017, at 9:52 AM, Hilaire <hila...@drgeo.eu> wrote:
> 
> Thanks Doru, it works as a charm!

Great.

> I don't think I could find it by myself, or I will have to become a Glamour 
> expert.

Actually, this is not really related to Glamour, but to how CompiledMethods are 
dealt with by the system. A CompiledMethod is immutable, so every time you 
change a method, a new CompiledMethod object gets created. So, if the browser 
shows CompiledMethods, you will always see the old version. This would have 
been the same without Glamour as well. That is why you need to show a 
RingMethodDefinition which only holds a reference made by the name of the 
method that is resolved dynamically.


> To make it perfect, there is still a fix needed for the DrGeo script browser:
> 
> The class method 'scriptName' of each Dr. Geo script class returns a string, 
> it used in the browser (and other place) to list meaningfully the script (and 
> not use the generic class name).
> 
> Therefore, when the user edit this method, the script name listed in the left 
> panel should be updated accordingly. I edit the code as bellow:
> 
> scriptsIn: constructor
>     constructor fastList
>         title: 'Scripts' translated;
>         display: [ :organiser |  organiser ];
>         format: #scriptName.
>     constructor  updateOn: MethodModified from: [ SystemAnnouncer 
> uniqueInstance ].
> 
> 
> It gives the expected behaviour. Is it the right way to do it?


constructor fastList creates a CompositePresentation that holds a 
ListPresentation. Think of a CompositePresentation as a morphic pane: it is a 
holder without much logic. The data you want to update is dealt with by 
ListPresentation. Thus, what you want to update is the list, not the whole 
composite.

scriptsIn: constructor
        constructor fastList
                title: 'Scripts' translated;
                display: [ :organiser |  organiser ];
                format: #scriptName;
                updateOn: MethodModified from: [ SystemAnnouncer uniqueInstance 
].

Cheers,
Doru



> Thanks
> 
> Hilaire
> 
> 
> Le 13/07/2017 à 11:50, Tudor Girba a écrit :
>> 
>> I took a quick look. To get the methods properly update and selected when 
>> modifying code, you should use the reference to the method, and the not the 
>> compiled method.
>> 
> 
> -- 
> Dr. Geo
> 
> http://drgeo.eu

--
www.tudorgirba.com
www.feenk.com

"Every successful trip needs a suitable vehicle."





Reply via email to