[chimera-dev] S3D extension
Tom Goddard
goddard at sonic.net
Thu Mar 20 15:42:08 PDT 2014
Hi Matt,
from chimera import tkgui
tkgui.setScreenMMWidth(w)
w = tkgui.getScreenMMWidth()
Here MM stands for millimeters.
In general you don't want your Python code to find graphical user interface controls (entry fields, sliders, …) and modify their values. Instead you modify the parameter values and the graphical user interface should detect the change and update themselves. The case of the Icosahedron tool is just a hack where only the graphical user has access to the radius parameter.
Tom
On Mar 19, 2014, at 11:13 PM, "Dougherty, Matthew T" wrote:
> Now that I am working on a similar problem it may have a similar solution to the previous email.
>
> Specifically I am trying to add an extension to control eye seperation in animations.
>
> using the icosahedron extension as a reference, I figure I need to make a similar gui call in def set_s3d(es), and change the gui to the camera tab.
>
> # -----------------------------------------------------------------------------
> #
> def change_s3d(start, last, step):
> range = (start, last, step)
> import Transition
> Transition.show_transition(set_s3d, range)
>
> # -----------------------------------------------------------------------------
> #
> def set_s3d(es):
> import Transition
> Transition.show_label('eye separation', 'r = %.0f' % es)
> import Icosahedron.gui
> d = Icosahedron.gui.icosahedron_dialog()
> if d:
> d.radius.set_value(es)
>
> # -----------------------------------------------------------------------------
> #
> import Transition
> arg_specs = (('es1', float),
> ('es2', float),
> ('frames', int))
>
> add_transition_command('s3d',
> change_s3d,
> arg_specs,
> None, None)
>
> # -----------------------------------------------------------------------------
> # -----------------------------------------------------------------------------
>
>
>
>
>
>
> Matthew Dougherty
> National Center for Macromolecular Imaging
> Baylor College of Medicine
> ________________________________________
> From: Dougherty, Matthew T
> Sent: Thursday, March 20, 2014 12:20 AM
> To: chimera-dev at cgl.ucsf.edu
> Subject: screen width
>
> I would like to set and get the parameter screen width. can you advise on the proper way?
>
> thx
>
>
> Matthew Dougherty
> National Center for Macromolecular Imaging
> Baylor College of Medicine
>
> _______________________________________________
> Chimera-dev mailing list
> Chimera-dev at cgl.ucsf.edu
> http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev
>
More information about the Chimera-dev
mailing list