Although we cannot answer specific questions about an
unsupported interface, your question about "self_cmd" is relevant to the overall
project since we are intending to support multiple PyMOL instances within
a single Python interpreter via:
from pymol2 import PyMOL
instance1 = PyMOL()
instance2 = PyMOL()
Thus, the old way of messaging the PyMOL
from pymol import cmd
will not work correctly if there two or more active
instances. Instead, each instance has its own "cmd" module and
As for "self_cmd", all Python-based code called from the C
layer must therefore be given a handle pointing at the instance from which it
was called so that it can do useful work. This is the role of the
self_cmd argument, and you'll see similar constructs in both the Python-based
wizards and the Tcl/Tk GUIs.
Unfortunately, the PyMOL's internal gui pop-up
menu system was not designed as nor intended to be a programmers interface and
is subject to change at any time. Any code which relies upon its behavior
may therefore break with future versions of the software.
I've read 'Executive.c' under
'/trunk/pymol/layer3', it seems that you've pre-defined all the cases that
button actions and popup menu changes in function ' ExecutiveClick ', I can
understand only part of it. Now, I'm wondering that if I want to implement my
thought ( - left-click the C-alpha atom in the structure, there will be a PopUp
window coming out with self-defined information in the Viewer window), I have to
modify the source code in C-layer and compile the whole source? Am I right? Or,
is there any trick to do this in Python-layer?
On Sun, Jun 22, 2008 at 1:59 PM, NeO <firstname.lastname@example.org
Dear Warren,I'm writing a
wizard, in which I want to implement the function that when I left-click the
C-alpha atom, there will be a PopUp window coming out with my defined
information in the Viewer window. I can do it using 'tkMessageBox.showinfo',
but I want to make it beautiful.
How are you?
I know that when you left-double click
or right-click the protein structure, the popup menu show up. I read the
source code of 'menu.py', I'm not sure in the function, the parameter
'self_cmd', what's it for? where the menu functions are called? If I figure it
out, I think I can code it in my wizard.
Hope you can help me