[chimera-dev] modify the menu bar

Eric Pettersen pett at cgl.ucsf.edu
Fri Jan 21 10:32:37 PST 2011


Hi Elisabeth,
	As Tom says, the code he refers to is really more complex than you  
need.  Just do this:

from chimera.tkgui import addMenu
myMenu = addMenu(label="menu name")

to create a top-level menu that you can add items to.  An example of  
its use in Chimera itself is in the _getAliasMenu() function in Midas/ 
midas_text.py.

--Eric

                         Eric Pettersen
                         UCSF Computer Graphics Lab
                         http://www.cgl.ucsf.edu

On Jan 21, 2011, at 9:20 AM, Tom Goddard wrote:

>  Hi Elisabeth,
>
>   There is some code in Chimera that makes a new top-level menu called
> Volume that is a copy of the Tools / Volume Data submenu.  That Volume
> menu is displayed using menu entry Tools / Volume Data / Volume Menu  
> on
> Menubar and if you show it it is remembered in the Chimera preferences
> file so it will appear every time you run Chimera.  This is a more
> complex than you need.  But the main routine that would be useful to
> study is called create_toplevel_volume_menu() in file
>
>     chimera / share / VolumeMenu / __init__.py
>
> in your Chimera distribution.  It would be easy to make a similar
> Chimera extension that made a toplevel Scripts menu and simply read  
> all
> the files in one of your directories and made menu entries which  
> caused
> the file to be opened in Chimera.  If you need more help with  
> writing it
> ask.
>
>     Tom
>
>
>> Dear Chimera Dev Team,
>>
>>
>> I'm trying to put other option in the menu bar (File, Select,  
>> Actions,
>> ... , myOption, Help) to store my own scripts. I'm doing a deep  
>> search
>> on your python and C++ codes but I don't find which is the code  
>> that I
>> have to modify.
>> I know that is easy to store my scripts in the Tools menu, but I
>> prefer to put my scripts in a new option of the menu bar.
>>
>>
>> Thanks a lot for taking the time to reply.
>>
>>
>>
>> Elisabeth Ortega
>> Autonomous University of Barcelona (UAB)
>
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20110121/e6486d15/attachment.html>


More information about the Chimera-dev mailing list