Registering a tool in the world menu

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Registering a tool in the world menu

hernanmd
Hi list,
  I'm using PharoCore 1.1 #11301. Now I want to adapt some tools to
use the new menu registration mechanism. When I evaluate:

menuCommandOn: aBuilder
        <worldMenu>
        (aBuilder item: #'Dependency Browser')
                parent: #Tools;
                action:[self open];
                icon:  UITheme current windowMenuForm.

the world menu is modified including only the Dependency Browser item
and all remaining items were removed. Did I miss something?
Cheers,

Hernán

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Registering a tool in the world menu

Marcus Denker-4

On Mar 31, 2010, at 8:28 AM, Hernán Morales Durand wrote:

> Hi list,
>  I'm using PharoCore 1.1 #11301. Now I want to adapt some tools to
> use the new menu registration mechanism. When I evaluate:
>
> menuCommandOn: aBuilder
> <worldMenu>
> (aBuilder item: #'Dependency Browser')
> parent: #Tools;
> action:[self open];
> icon:  UITheme current windowMenuForm.
>
> the world menu is modified including only the Dependency Browser item
> and all remaining items were removed. Did I miss something?
>

You need to execute

        World resetWorldMenu

This gathers all the methods with the worldMenu tag and executes them.

        Marcus



--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Registering a tool in the world menu

Alain Plantec-4
In reply to this post by hernanmd
Hernán Morales Durand a écrit :

> Hi list,
>   I'm using PharoCore 1.1 #11301. Now I want to adapt some tools to
> use the new menu registration mechanism. When I evaluate:
>
> menuCommandOn: aBuilder
> <worldMenu>
> (aBuilder item: #'Dependency Browser')
> parent: #Tools;
> action:[self open];
> icon:  UITheme current windowMenuForm.

> the world menu is modified including only the Dependency Browser item
> and all remaining items were removed. Did I miss something?
>  
No, normally the only thing to do is to
declare such a method on the class side.
I tried your #menuCommandOn: and the world menu
is updated as it should be.
Is the entire world menu corrupted or only
the #Tools submenu ?

Alain
> Cheers,
>
> Hernán
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Registering a tool in the world menu

Alain Plantec-4
In reply to this post by Marcus Denker-4
Marcus Denker a écrit :

> On Mar 31, 2010, at 8:28 AM, Hernán Morales Durand wrote:
>
>  
>> Hi list,
>>  I'm using PharoCore 1.1 #11301. Now I want to adapt some tools to
>> use the new menu registration mechanism. When I evaluate:
>>
>> menuCommandOn: aBuilder
>> <worldMenu>
>> (aBuilder item: #'Dependency Browser')
>> parent: #Tools;
>> action:[self open];
>> icon:  UITheme current windowMenuForm.
>>
>> the world menu is modified including only the Dependency Browser item
>> and all remaining items were removed. Did I miss something?
>>
>>    
>
> You need to execute
>
> World resetWorldMenu
>
> This gathers all the methods with the worldMenu tag and executes them.
>  
normally you don't need to execute 'World resetWorldMenu'.
The world menu is automatically rebuilt each time
a method containing a <worldMenu> pragma is compiled.
Alain

> Marcus
>
>
>
> --
> Marcus Denker  -- http://www.marcusdenker.de
> INRIA Lille -- Nord Europe. Team RMoD.
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>  


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: Registering a tool in the world menu

hernanmd
2010/3/31 Alain Plantec <[hidden email]>:

> Marcus Denker a écrit :
>>
>> On Mar 31, 2010, at 8:28 AM, Hernán Morales Durand wrote:
>>
>>
>>>
>>> Hi list,
>>>  I'm using PharoCore 1.1 #11301. Now I want to adapt some tools to
>>> use the new menu registration mechanism. When I evaluate:
>>>
>>> menuCommandOn: aBuilder
>>>        <worldMenu>
>>>        (aBuilder item: #'Dependency Browser')
>>>                parent: #Tools;
>>>                action:[self open];
>>>                icon:  UITheme current windowMenuForm.
>>>
>>> the world menu is modified including only the Dependency Browser item
>>> and all remaining items were removed. Did I miss something?
>>>
>>>
>>
>> You need to execute
>>
>>        World resetWorldMenu
>>
>> This gathers all the methods with the worldMenu tag and executes them.
>>
>
> normally you don't need to execute 'World resetWorldMenu'.
> The world menu is automatically rebuilt each time
> a method containing a <worldMenu> pragma is compiled.
> Alain
>
Thank you Alain and Marcus. I have not access to the imagen with the
problem now, but it should be weird because I cannot reproduce the bug
again.

IIRC in Squeak people is using the #registerOpenCommand: message, is
there a standard way to avoid the platform or version specific
Deprecation Warnings in Pharo?  (please see the attachment)

I do not want to check

Smalltalk version isSqueak ifTrue: [ ... ] ifFalse: [ Smalltalk
version isPharo ifFalse: [ ... isCuis ] etc.

Cheers,

Hernán

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Deprecation1.jpg (90K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Registering a tool in the world menu

Marcus Denker-4

On Apr 1, 2010, at 6:26 PM, Hernán Morales Durand wrote:

>
>
> IIRC in Squeak people is using the #registerOpenCommand: message, is
> there a standard way to avoid the platform or version specific
> Deprecation Warnings in Pharo?  (please see the attachment)
>
> I do not want to check
>
> Smalltalk version isSqueak ifTrue: [ ... ] ifFalse: [ Smalltalk
> version isPharo ifFalse: [ ... isCuis ] etc.


We could remove the deprecation for now and just do nothing.

        Marcus

--
Marcus Denker  -- http://www.marcusdenker.de
INRIA Lille -- Nord Europe. Team RMoD.


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project