Question: How can I add a items to System Browser Window menu?

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

Question: How can I add a items to System Browser Window menu?

Carla F. Griggio
Hello!

I want to add an item to the menu that appears when you right click on a category in the System Browser window.

I think that menu is built here:

Morph>>buildMetaMenu: evt

But I don't want to touch that method, not SystemWindow>>buildMetaMenu: evt either, because that option would have to be visible only if my project has been loaded.

Is there a way to do that?

Thanks!
Carla

_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

Stéphane Ducasse



On Aug 7, 2010, at 12:22 PM, Carla F. Griggio wrote:

> Hello!
>
> I want to add an item to the menu that appears when you right click on a category in the System Browser window.
>
> I think that menu is built here:
>
> Morph>>buildMetaMenu: evt
>
> But I don't want to touch that method, not SystemWindow>>buildMetaMenu: evt either, because that option would have to be visible only if my project has been loaded.

exactly nobody should change the core methods just declare intention.
>
> Is there a way to do that?

sure.
you should use a pragma <menu>

here is for example how this is done for ScriptLoader

menuCommandOn: aBuilder
        <worldMenu>
       
        (aBuilder item: #'Integrator Menu')
                order: 1.5;
                precondition: [self currentlyIntegratingChanges];
                parent: #System;  
                action: [ScriptLoader releaseMenu]



>
> Thanks!
> Carla
> _______________________________________________
> 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: Question: How can I add a items to System Browser Window menu?

Guillermo Polito
I think Car meant the context menu when you right-clic a category in the System Browser.  I don't know how, but maybe my screenshot help someone to help you :).

On Sat, Aug 7, 2010 at 8:11 AM, Stéphane Ducasse <[hidden email]> wrote:



On Aug 7, 2010, at 12:22 PM, Carla F. Griggio wrote:

> Hello!
>
> I want to add an item to the menu that appears when you right click on a category in the System Browser window.
>
> I think that menu is built here:
>
> Morph>>buildMetaMenu: evt
>
> But I don't want to touch that method, not SystemWindow>>buildMetaMenu: evt either, because that option would have to be visible only if my project has been loaded.

exactly nobody should change the core methods just declare intention.
>
> Is there a way to do that?

sure.
you should use a pragma <menu>

here is for example how this is done for ScriptLoader

menuCommandOn: aBuilder
       <worldMenu>

       (aBuilder item: #'Integrator Menu')
               order: 1.5;
               precondition: [self currentlyIntegratingChanges];
               parent: #System;
               action: [ScriptLoader releaseMenu]



>
> Thanks!
> Carla
> _______________________________________________
> 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


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

categoryMenu.png (184K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Question: How can I add a items to System Browser Window menu?

Carla F. Griggio
Yes!
I looked for other examples with the pragma, but they were for the World menu (thanks anyway!).
I meant the menu that Guille captured.

2010/8/7 Guillermo Polito <[hidden email]>
I think Car meant the context menu when you right-clic a category in the System Browser.  I don't know how, but maybe my screenshot help someone to help you :).


On Sat, Aug 7, 2010 at 8:11 AM, Stéphane Ducasse <[hidden email]> wrote:



On Aug 7, 2010, at 12:22 PM, Carla F. Griggio wrote:

> Hello!
>
> I want to add an item to the menu that appears when you right click on a category in the System Browser window.
>
> I think that menu is built here:
>
> Morph>>buildMetaMenu: evt
>
> But I don't want to touch that method, not SystemWindow>>buildMetaMenu: evt either, because that option would have to be visible only if my project has been loaded.

exactly nobody should change the core methods just declare intention.
>
> Is there a way to do that?

sure.
you should use a pragma <menu>

here is for example how this is done for ScriptLoader

menuCommandOn: aBuilder
       <worldMenu>

       (aBuilder item: #'Integrator Menu')
               order: 1.5;
               precondition: [self currentlyIntegratingChanges];
               parent: #System;
               action: [ScriptLoader releaseMenu]



>
> Thanks!
> Carla
> _______________________________________________
> 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


_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

hernanmd
In reply to this post by Carla F. Griggio
Hi Carla,

2010/8/7 Carla F. Griggio <[hidden email]>:
> Hello!
>
> I want to add an item to the menu that appears when you right click on a
> category in the System Browser window.
>

System Browser or OmniBrowser on system categories?

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: Question: How can I add a items to System Browser Window menu?

Carla F. Griggio
Exactly what Guille captured in the image he attached. When I open that window from the World menu it says 'System Browser', although it could actually be an OmniBrowser on the system categories internally... Are they two different things?
If they are, how can I open both? (Because until now I thought they were the same thing).
I might be interested in customizing both :P


On Sat, Aug 7, 2010 at 9:13 PM, Hernán Morales Durand <[hidden email]> wrote:
Hi Carla,

2010/8/7 Carla F. Griggio <[hidden email]>:
> Hello!
>
> I want to add an item to the menu that appears when you right click on a
> category in the System Browser window.
>

System Browser or OmniBrowser on system categories?

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: Question: How can I add a items to System Browser Window menu?

hernanmd
2010/8/9 Carla F. Griggio <[hidden email]>:
> Exactly what Guille captured in the image he attached. When I open that
> window from the World menu it says 'System Browser', although it could
> actually be an OmniBrowser on the system categories internally... Are they
> two different things?

I don't know which image you are using, some Pharo images includes the
OmniBrowser package already loaded and this is what you're probably
opening from the World menu.

It isn't clear from the world menu which browser (System or Omni)
you're going to open.
You might want to use both or more system browsers (there are other
system browsers) at the same time. I use both tools often.

The System Browser is the "classic" browser in Squeak, you may open it
evaluating

Browser open

The OmniBrowser System Browser is a browser based on the OmniBrowser
framework and it is opened evaluating

OBSystemBrowser open

I strongly suggest to choose the OmniBrowser way, it is a really good
framework, nicely supported and there is some documentation in PDF
format out there. The only drawback I saw is it is hard to develop a
browser to browse other things which are not "code".

Cheers,

Hernán

> If they are, how can I open both? (Because until now I thought they were the
> same thing).
> I might be interested in customizing both :P
>
>
> On Sat, Aug 7, 2010 at 9:13 PM, Hernán Morales Durand
> <[hidden email]> wrote:
>>
>> Hi Carla,
>>
>> 2010/8/7 Carla F. Griggio <[hidden email]>:
>> > Hello!
>> >
>> > I want to add an item to the menu that appears when you right click on a
>> > category in the System Browser window.
>> >
>>
>> System Browser or OmniBrowser on system categories?
>>
>> 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
>

_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

Carla F. Griggio
Ohh, I understand now.
I was using the OmniBrowser System Browser.

Either case, I don't know how I can customize the menu that appears when I right click on a category without changing the original code :( I want to "extend" that, not change it, just add a new comand option.
Do you know if it's possible?

I can change it adding an option in Morph>>buildMetaMenu: evt, but I wanted to keep that code clean...


On Tue, Aug 10, 2010 at 12:25 AM, Hernán Morales Durand <[hidden email]> wrote:
2010/8/9 Carla F. Griggio <[hidden email]>:
> Exactly what Guille captured in the image he attached. When I open that
> window from the World menu it says 'System Browser', although it could
> actually be an OmniBrowser on the system categories internally... Are they
> two different things?

I don't know which image you are using, some Pharo images includes the
OmniBrowser package already loaded and this is what you're probably
opening from the World menu.

It isn't clear from the world menu which browser (System or Omni)
you're going to open.
You might want to use both or more system browsers (there are other
system browsers) at the same time. I use both tools often.

The System Browser is the "classic" browser in Squeak, you may open it
evaluating

Browser open

The OmniBrowser System Browser is a browser based on the OmniBrowser
framework and it is opened evaluating

OBSystemBrowser open

I strongly suggest to choose the OmniBrowser way, it is a really good
framework, nicely supported and there is some documentation in PDF
format out there. The only drawback I saw is it is hard to develop a
browser to browse other things which are not "code".

Cheers,

Hernán

> If they are, how can I open both? (Because until now I thought they were the
> same thing).
> I might be interested in customizing both :P
>
>
> On Sat, Aug 7, 2010 at 9:13 PM, Hernán Morales Durand
> <[hidden email]> wrote:
>>
>> Hi Carla,
>>
>> 2010/8/7 Carla F. Griggio <[hidden email]>:
>> > Hello!
>> >
>> > I want to add an item to the menu that appears when you right click on a
>> > category in the System Browser window.
>> >
>>
>> System Browser or OmniBrowser on system categories?
>>
>> 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
>

_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

Carla F. Griggio
By the way, if that method only has sense when right clicking on a System Window category list, why is it defined in the class Morph?

On Tue, Aug 10, 2010 at 1:13 AM, Carla F. Griggio <[hidden email]> wrote:
Ohh, I understand now.
I was using the OmniBrowser System Browser.

Either case, I don't know how I can customize the menu that appears when I right click on a category without changing the original code :( I want to "extend" that, not change it, just add a new comand option.
Do you know if it's possible?

I can change it adding an option in Morph>>buildMetaMenu: evt, but I wanted to keep that code clean...



On Tue, Aug 10, 2010 at 12:25 AM, Hernán Morales Durand <[hidden email]> wrote:
2010/8/9 Carla F. Griggio <[hidden email]>:
> Exactly what Guille captured in the image he attached. When I open that
> window from the World menu it says 'System Browser', although it could
> actually be an OmniBrowser on the system categories internally... Are they
> two different things?

I don't know which image you are using, some Pharo images includes the
OmniBrowser package already loaded and this is what you're probably
opening from the World menu.

It isn't clear from the world menu which browser (System or Omni)
you're going to open.
You might want to use both or more system browsers (there are other
system browsers) at the same time. I use both tools often.

The System Browser is the "classic" browser in Squeak, you may open it
evaluating

Browser open

The OmniBrowser System Browser is a browser based on the OmniBrowser
framework and it is opened evaluating

OBSystemBrowser open

I strongly suggest to choose the OmniBrowser way, it is a really good
framework, nicely supported and there is some documentation in PDF
format out there. The only drawback I saw is it is hard to develop a
browser to browse other things which are not "code".

Cheers,

Hernán

> If they are, how can I open both? (Because until now I thought they were the
> same thing).
> I might be interested in customizing both :P
>
>
> On Sat, Aug 7, 2010 at 9:13 PM, Hernán Morales Durand
> <[hidden email]> wrote:
>>
>> Hi Carla,
>>
>> 2010/8/7 Carla F. Griggio <[hidden email]>:
>> > Hello!
>> >
>> > I want to add an item to the menu that appears when you right click on a
>> > category in the System Browser window.
>> >
>>
>> System Browser or OmniBrowser on system categories?
>>
>> 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
>

_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

laurent laffont
In reply to this post by Carla F. Griggio
2010/8/10 Carla F. Griggio <[hidden email]>
Ohh, I understand now.
I was using the OmniBrowser System Browser.

Either case, I don't know how I can customize the menu that appears when I right click on a category without changing the original code :( I want to "extend" that, not change it, just add a new comand option.
Do you know if it's possible?

You need to create a subclass of OBCommand which define these methods:
execute: what to do when clicking on it
group: answers a symbol to know in which group it will be displayed in
isActive: answers if the item is enabled/disabled
keystroke: answers the char for shortcut
label: answers the label
order: answers the position

example:

OBCommand subclass: #OBCmdRunAutotest
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'OB-Autotest'

execute
|method|
method := target theClass >> target selector.
OBWaitRequest block: [  AutotestDashboard default triggerAutotestOn: method ].

group
^ #testing

isActive
^ (requestor isSelected: target) and: [target isKindOf: OBMethodNode ]

keystroke
^ $T

label
^ 'trigger autotest'

order
^ '3'


Look at OBCommand subclasses for more examples.

Cheers, 

Laurent Laffont

http://pharocasts.blogspot.com/
http://magaloma.blogspot.com/
 
I can change it adding an option in Morph>>buildMetaMenu: evt, but I wanted to keep that code clean...



On Tue, Aug 10, 2010 at 12:25 AM, Hernán Morales Durand <[hidden email]> wrote:
2010/8/9 Carla F. Griggio <[hidden email]>:
> Exactly what Guille captured in the image he attached. When I open that
> window from the World menu it says 'System Browser', although it could
> actually be an OmniBrowser on the system categories internally... Are they
> two different things?

I don't know which image you are using, some Pharo images includes the
OmniBrowser package already loaded and this is what you're probably
opening from the World menu.

It isn't clear from the world menu which browser (System or Omni)
you're going to open.
You might want to use both or more system browsers (there are other
system browsers) at the same time. I use both tools often.

The System Browser is the "classic" browser in Squeak, you may open it
evaluating

Browser open

The OmniBrowser System Browser is a browser based on the OmniBrowser
framework and it is opened evaluating

OBSystemBrowser open

I strongly suggest to choose the OmniBrowser way, it is a really good
framework, nicely supported and there is some documentation in PDF
format out there. The only drawback I saw is it is hard to develop a
browser to browse other things which are not "code".

Cheers,

Hernán

> If they are, how can I open both? (Because until now I thought they were the
> same thing).
> I might be interested in customizing both :P
>
>
> On Sat, Aug 7, 2010 at 9:13 PM, Hernán Morales Durand
> <[hidden email]> wrote:
>>
>> Hi Carla,
>>
>> 2010/8/7 Carla F. Griggio <[hidden email]>:
>> > Hello!
>> >
>> > I want to add an item to the menu that appears when you right click on a
>> > category in the System Browser window.
>> >
>>
>> System Browser or OmniBrowser on system categories?
>>
>> 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
>

_______________________________________________
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


_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

Carla F. Griggio
Thanks!!! I'll try that! :D

2010/8/10 laurent laffont <[hidden email]>
2010/8/10 Carla F. Griggio <[hidden email]>

Ohh, I understand now.
I was using the OmniBrowser System Browser.

Either case, I don't know how I can customize the menu that appears when I right click on a category without changing the original code :( I want to "extend" that, not change it, just add a new comand option.
Do you know if it's possible?

You need to create a subclass of OBCommand which define these methods:
execute: what to do when clicking on it
group: answers a symbol to know in which group it will be displayed in
isActive: answers if the item is enabled/disabled
keystroke: answers the char for shortcut
label: answers the label
order: answers the position

example:

OBCommand subclass: #OBCmdRunAutotest
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'OB-Autotest'

execute
|method|
method := target theClass >> target selector.
OBWaitRequest block: [  AutotestDashboard default triggerAutotestOn: method ].

group
^ #testing

isActive
^ (requestor isSelected: target) and: [target isKindOf: OBMethodNode ]

keystroke
^ $T

label
^ 'trigger autotest'

order
^ '3'


Look at OBCommand subclasses for more examples.

Cheers, 

Laurent Laffont

http://pharocasts.blogspot.com/
http://magaloma.blogspot.com/

 
I can change it adding an option in Morph>>buildMetaMenu: evt, but I wanted to keep that code clean...



On Tue, Aug 10, 2010 at 12:25 AM, Hernán Morales Durand <[hidden email]> wrote:
2010/8/9 Carla F. Griggio <[hidden email]>:
> Exactly what Guille captured in the image he attached. When I open that
> window from the World menu it says 'System Browser', although it could
> actually be an OmniBrowser on the system categories internally... Are they
> two different things?

I don't know which image you are using, some Pharo images includes the
OmniBrowser package already loaded and this is what you're probably
opening from the World menu.

It isn't clear from the world menu which browser (System or Omni)
you're going to open.
You might want to use both or more system browsers (there are other
system browsers) at the same time. I use both tools often.

The System Browser is the "classic" browser in Squeak, you may open it
evaluating

Browser open

The OmniBrowser System Browser is a browser based on the OmniBrowser
framework and it is opened evaluating

OBSystemBrowser open

I strongly suggest to choose the OmniBrowser way, it is a really good
framework, nicely supported and there is some documentation in PDF
format out there. The only drawback I saw is it is hard to develop a
browser to browse other things which are not "code".

Cheers,

Hernán

> If they are, how can I open both? (Because until now I thought they were the
> same thing).
> I might be interested in customizing both :P
>
>
> On Sat, Aug 7, 2010 at 9:13 PM, Hernán Morales Durand
> <[hidden email]> wrote:
>>
>> Hi Carla,
>>
>> 2010/8/7 Carla F. Griggio <[hidden email]>:
>> > Hello!
>> >
>> > I want to add an item to the menu that appears when you right click on a
>> > category in the System Browser window.
>> >
>>
>> System Browser or OmniBrowser on system categories?
>>
>> 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
>

_______________________________________________
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


_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

Mariano Martinez Peck
what would be create is to step by step make all menus easily extenesible. Like nowadays with the world menu and pragmas

Carla, once I had a similar problem and the only solution was to override that method with a *MyPackage in that method, and add there the menu entried I wanted...this is completly wrong and sucks...but was the only thing I found

cheers

2010/8/10 Carla F. Griggio <[hidden email]>
Thanks!!! I'll try that! :D

2010/8/10 laurent laffont <[hidden email]>

2010/8/10 Carla F. Griggio <[hidden email]>

Ohh, I understand now.
I was using the OmniBrowser System Browser.

Either case, I don't know how I can customize the menu that appears when I right click on a category without changing the original code :( I want to "extend" that, not change it, just add a new comand option.
Do you know if it's possible?

You need to create a subclass of OBCommand which define these methods:
execute: what to do when clicking on it
group: answers a symbol to know in which group it will be displayed in
isActive: answers if the item is enabled/disabled
keystroke: answers the char for shortcut
label: answers the label
order: answers the position

example:

OBCommand subclass: #OBCmdRunAutotest
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'OB-Autotest'

execute
|method|
method := target theClass >> target selector.
OBWaitRequest block: [  AutotestDashboard default triggerAutotestOn: method ].

group
^ #testing

isActive
^ (requestor isSelected: target) and: [target isKindOf: OBMethodNode ]

keystroke
^ $T

label
^ 'trigger autotest'

order
^ '3'


Look at OBCommand subclasses for more examples.

Cheers, 

Laurent Laffont

http://pharocasts.blogspot.com/
http://magaloma.blogspot.com/

 
I can change it adding an option in Morph>>buildMetaMenu: evt, but I wanted to keep that code clean...



On Tue, Aug 10, 2010 at 12:25 AM, Hernán Morales Durand <[hidden email]> wrote:
2010/8/9 Carla F. Griggio <[hidden email]>:
> Exactly what Guille captured in the image he attached. When I open that
> window from the World menu it says 'System Browser', although it could
> actually be an OmniBrowser on the system categories internally... Are they
> two different things?

I don't know which image you are using, some Pharo images includes the
OmniBrowser package already loaded and this is what you're probably
opening from the World menu.

It isn't clear from the world menu which browser (System or Omni)
you're going to open.
You might want to use both or more system browsers (there are other
system browsers) at the same time. I use both tools often.

The System Browser is the "classic" browser in Squeak, you may open it
evaluating

Browser open

The OmniBrowser System Browser is a browser based on the OmniBrowser
framework and it is opened evaluating

OBSystemBrowser open

I strongly suggest to choose the OmniBrowser way, it is a really good
framework, nicely supported and there is some documentation in PDF
format out there. The only drawback I saw is it is hard to develop a
browser to browse other things which are not "code".

Cheers,

Hernán

> If they are, how can I open both? (Because until now I thought they were the
> same thing).
> I might be interested in customizing both :P
>
>
> On Sat, Aug 7, 2010 at 9:13 PM, Hernán Morales Durand
> <[hidden email]> wrote:
>>
>> Hi Carla,
>>
>> 2010/8/7 Carla F. Griggio <[hidden email]>:
>> > Hello!
>> >
>> > I want to add an item to the menu that appears when you right click on a
>> > category in the System Browser window.
>> >
>>
>> System Browser or OmniBrowser on system categories?
>>
>> 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
>

_______________________________________________
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


_______________________________________________
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


_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

Stéphane Ducasse
Yes!!!
We should move step by step and fix all the points one by one.
And since it takes time we should make priority. :)


> what would be create is to step by step make all menus easily extenesible. Like nowadays with the world menu and pragmas
>
> Carla, once I had a similar problem and the only solution was to override that method with a *MyPackage in that method, and add there the menu entried I wanted...this is completly wrong and sucks...but was the only thing I found
>
> cheers


_______________________________________________
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: Question: How can I add a items to System Browser Window menu?

Lukas Renggli
In reply to this post by Mariano Martinez Peck
But in OB that should be easy. You can add, remove and change any
command without the need for an override. The only exception is the
code pane which gets its is commands from the Paragraph editor.

Lukas

On Tuesday, August 10, 2010, Mariano Martinez Peck
<[hidden email]> wrote:

> what would be create is to step by step make all menus easily extenesible. Like nowadays with the world menu and pragmas
>
> Carla, once I had a similar problem and the only solution was to override that method with a *MyPackage in that method, and add there the menu entried I wanted...this is completly wrong and sucks...but was the only thing I found
>
> cheers
>
> 2010/8/10 Carla F. Griggio <[hidden email]>
>
> Thanks!!! I'll try that! :D
>
> 2010/8/10 laurent laffont <[hidden email]>
>
>
>
> 2010/8/10 Carla F. Griggio <[hidden email]>
>
>
>
>
>
> Ohh, I understand now.
> I was using the OmniBrowser System Browser.
>
> Either case, I don't know how I can customize the menu that appears when I right click on a category without changing the original code :( I want to "extend" that, not change it, just add a new comand option.
> Do you know if it's possible?
>
> You need to create a subclass of OBCommand which define these methods:execute: what to do when clicking on itgroup: answers a symbol to know in which group it will be displayed in
>
>
>
>
> isActive: answers if the item is enabled/disabledkeystroke: answers the char for shortcutlabel: answers the labelorder: answers the position
> example:
>
>
>
>
>
> OBCommand subclass: #OBCmdRunAutotest instanceVariableNames: '' classVariableNames: ''
>
>
>
>
> poolDictionaries: '' category: 'OB-Autotest'
>
>
> execute |method| method := target theClass >> target selector.
>
> OBWaitRequest block: [  AutotestDashboard default triggerAutotestOn: method ].
> group ^ #testing
>
>
>
>
>
> isActive ^ (requestor isSelected: target) and: [target isKindOf: OBMethodNode ]
> keystroke
>
> ^ $T
> label ^ 'trigger autotest'
>
>
> order ^ '3'
>
> Look at OBCommand subclasses for more examples.
>
> Cheers, Laurent Laffont
>
> http://pharocasts.blogspot.com/
> http://magaloma.blogspot.com/
>
>
>
>  I can change it adding an option in Morph>>buildMetaMenu: evt, but I wanted to keep that code clean...
>
>
>
>
>
>
>
> On Tue, Aug 10, 2010 at 12:25 AM, Hernán Morales Durand <[hidden email]> wrote:
> 2010/8/9 Carla F. Griggio <[hidden email]>:
>> Exactly what Guille captured in the image he attached. When I open that
>> window from the World menu it says 'System Browser', although it could
>> actually be an OmniBrowser on the system categories internally... Are they
>> two different things?
>
> I don't know which image you are using, some Pharo images includes the
> OmniBrowser package already loaded and this is what you're probably
> opening from the World menu.
>
> It isn't clear from the world menu which browser (System or Omni)
> you're going to open.
> You mi

--
Lukas Renggli
www.lukas-renggli.ch

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