Re: [PyMOL] Custom menus and shortcuts?

2012-10-24 Thread Thomas Holder
Hi Boris, Boris Kheyfets wrote, On 10/23/12 19:28: [...] But I want bk_hides_W to be a toggler. So I need a way to set a state of my defun. If I do def bk_toggles_W (): Hides W molecules. if cmd.get(bk_toggles_W): cmd.hide(all) cmd.show(spheres, not (resn W))

Re: [PyMOL] Custom menus and shortcuts?

2012-10-24 Thread Boris Kheyfets
If you need a global variable, use pymol.stored Thank You Thomas -- that solves it. Boris. On Tue, Oct 23, 2012 at 9:28 PM, Boris Kheyfets kheyfbo...@gmail.comwrote: Found a solution. Basically it is to add pmg_tk/startup/newmenu.py file with the following content: from Tkinter

Re: [PyMOL] Custom menus and shortcuts?

2012-10-23 Thread David Hall
http://pymolwiki.org/index.php/Set_Key http://pymolwiki.org/index.php/Extend is also useful. -David On Tuesday, October 23, 2012 at 6:02 AM, Boris Kheyfets wrote: Hello PyMOL users, Menus = Is there a way I can add custom menu in PyMOL? Ideally I'd like to be able to call

Re: [PyMOL] Custom menus and shortcuts?

2012-10-23 Thread Boris Kheyfets
Found a solution. Basically it is to add pmg_tk/startup/newmenu.py file with the following content: from Tkinter import * from pymol import cmd def __init__(self): self.menuBar.addmenu('NewMenu', 'Sample Menu') self.menuBar.addmenuitem('NewMenu', 'command',

Re: [PyMOL] Custom menus and shortcuts?

2012-10-23 Thread Jason Vertrees
Hi Boris, David Hall's suggestions are perfect. Let me offer one more. If you can put up with programming a little Python, check out pymol/modules/pymol/menu.py and pymol/modules/pymol/preset.py. In menu.py you could add a No W menu option (or similar) to the A Preset Cheers, -- Jason On