> hi there. quick question: how to code a function 'go to a given position (x,y,z)
> in a given window'?
Use AnalysisPopup gotoPosition(windowName, position, row=None, col=None),
where position is a dictionary of the form {'x':7.234,'y':4.236,'z1':127.654}
and row and col optionally specify a panel (or strip) of the window.
WindowPopup (as a subclass of WindowDraw) also has a gotoPosition()
function, but of course here you don't have to specify the name of the
window.
A simple macro would be:
def myGotoFunction(argServer, windowName, position):
analysisPopup = argServer.parent
analysisPopup.gotoPosition(windowName, position)
Or for a macro run from a window you could use something like:
def myWindowGotoFunction(argServer, position):
windowPopup = argServer.getCurrentWindowPopup()
windowPopup.gotoPosition(position)
In some future version a documented gotoPosition function will appear in
WindowBasic.py
Tim
-------------------------------------------------------------------------------
Dr Tim Stevens Email: [log in to unmask]
Department of Biochemistry [log in to unmask]
University of Cambridge Phone: +44 1223 766022 (office)
80 Tennis Court Road +44 7816 338275 (mobile)
Old Addenbrooke's Site +44 1223 364613 (home)
Cambridge CB2 1GA WWWeb: http://www.bio.cam.ac.uk/~tjs23
United Kingdom http://www.pantonia.co.uk
-------------------------------------------------------------------------------
------ +NH3CH(CH(CH3)OH)C(O)NHCH(CH(CH3)CH2CH3)C(O)NHCH(CH2CH2SCH3)CO2- -------
-------------------------------------------------------------------------------
|