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

> 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 <
> [email protected]> wrote:
>
>> 2010/8/9 Carla F. Griggio <[email protected]>:
>> > 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
>> > <[email protected]> wrote:
>> >>
>> >> Hi Carla,
>> >>
>> >> 2010/8/7 Carla F. Griggio <[email protected]>:
>> >> > 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
>> >> [email protected]
>> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>> > _______________________________________________
>> > Pharo-project mailing list
>> > [email protected]
>> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>> >
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [email protected]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to