Extending browser's context menu

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

Extending browser's context menu

Markus Fritsche-3
Hello list,

I was searching for the right (sustainable) way to extend the browser
menu. I searched for the menu labels (show "methods with strings in
it" etc.) but couldn't find it, so there must be another hook. Could
anyone give me quick pointer?

TIA,
Markus

Reply | Threaded
Open this post in threaded view
|

Re: Extending browser's context menu

Ramon Leon-5
On 05/05/2011 01:45 PM, Markus Fritsche wrote:
> Hello list,
>
> I was searching for the right (sustainable) way to extend the browser
> menu. I searched for the menu labels (show "methods with strings in
> it" etc.) but couldn't find it, so there must be another hook. Could
> anyone give me quick pointer?
>
> TIA,
> Markus

myMenuCommandOn: aBuilder
     <worldMenu>
     aBuilder item: #MyStuff

myFullScreenMenuCommandOn: aBuilder
     <worldMenu>
     (aBuilder item: #'Full Screen')
         parent: #MyStuff;
         action: [ DisplayScreen new toggleFullScreen ]

Of course, #parent: could also point at an existing menu if you're just
adding to what's already there.  Doesn't matter where you put these,
they're found by the <worldMenu> pragma.

--
Ramon Leon
http://onsmalltalk.com

Reply | Threaded
Open this post in threaded view
|

Re: Extending browser's context menu

Mariano Martinez Peck
Ramon, I think he is asking about BROWSER menus, that is, extending OB context menu ;)

On Thu, May 5, 2011 at 11:59 PM, Ramon Leon <[hidden email]> wrote:
On 05/05/2011 01:45 PM, Markus Fritsche wrote:
Hello list,

I was searching for the right (sustainable) way to extend the browser
menu. I searched for the menu labels (show "methods with strings in
it" etc.) but couldn't find it, so there must be another hook. Could
anyone give me quick pointer?

TIA,
Markus

myMenuCommandOn: aBuilder
   <worldMenu>
   aBuilder item: #MyStuff

myFullScreenMenuCommandOn: aBuilder
   <worldMenu>
   (aBuilder item: #'Full Screen')
       parent: #MyStuff;
       action: [ DisplayScreen new toggleFullScreen ]

Of course, #parent: could also point at an existing menu if you're just adding to what's already there.  Doesn't matter where you put these, they're found by the <worldMenu> pragma.

--
Ramon Leon
http://onsmalltalk.com




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: Extending browser's context menu

Markus Fritsche-3
Thanks for the worldMenu pragma explanation - I wondered about that
one but not enough to really look into that one yet :)

So for the Brower, Browser>>#messageListMenu: aMenu shifted: shifted
is the right place to alter the method name context menu - right?

Regards,
Markus


2011/5/6 Mariano Martinez Peck <[hidden email]>:

> Ramon, I think he is asking about BROWSER menus, that is, extending OB
> context menu ;)
>
> On Thu, May 5, 2011 at 11:59 PM, Ramon Leon <[hidden email]>
> wrote:
>>
>> On 05/05/2011 01:45 PM, Markus Fritsche wrote:
>>>
>>> Hello list,
>>>
>>> I was searching for the right (sustainable) way to extend the browser
>>> menu. I searched for the menu labels (show "methods with strings in
>>> it" etc.) but couldn't find it, so there must be another hook. Could
>>> anyone give me quick pointer?
>>>
>>> TIA,
>>> Markus
>>
>> myMenuCommandOn: aBuilder
>>    <worldMenu>
>>    aBuilder item: #MyStuff
>>
>> myFullScreenMenuCommandOn: aBuilder
>>    <worldMenu>
>>    (aBuilder item: #'Full Screen')
>>        parent: #MyStuff;
>>        action: [ DisplayScreen new toggleFullScreen ]
>>
>> Of course, #parent: could also point at an existing menu if you're just
>> adding to what's already there.  Doesn't matter where you put these, they're
>> found by the <worldMenu> pragma.
>>
>> --
>> Ramon Leon
>> http://onsmalltalk.com
>>
>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Extending browser's context menu

DougEdmunds
In reply to this post by Markus Fritsche-3
I jotted down some notes on how some of the menus are built.
Might be something in there that helps.

http://dougedmunds.com/pmwiki.php?n=Pharo.MenuSystem
Reply | Threaded
Open this post in threaded view
|

Re: Extending browser's context menu

Ramon Leon-5
In reply to this post by Mariano Martinez Peck
On 05/05/2011 03:25 PM, Mariano Martinez Peck wrote:
> Ramon, I think he is asking about BROWSER menus, that is, extending OB
> context menu ;)

Oops, my bad, wasn't paying close enough attention I guess.

--
Ramon Leon
http://onsmalltalk.com

Reply | Threaded
Open this post in threaded view
|

Re: Extending browser's context menu

Mariano Martinez Peck


On Fri, May 6, 2011 at 12:58 AM, Ramon Leon <[hidden email]> wrote:
On 05/05/2011 03:25 PM, Mariano Martinez Peck wrote:
Ramon, I think he is asking about BROWSER menus, that is, extending OB
context menu ;)

Oops, my bad, wasn't paying close enough attention I guess.


No problem, it seems it was useful anyway ;)



--
Mariano
http://marianopeck.wordpress.com