[chimera-dev] color editor
Eric Pettersen
pett at cgl.ucsf.edu
Thu Oct 15 16:50:40 PDT 2015
> On Oct 14, 2015, at 6:09 PM, Dougherty, Matthew T <matthewd at bcm.edu> wrote:
>
> when I use
>
> from chimera import dialogs
> ce = dialogs.display('color editor')
>
>
> it brings up the color editor, but model colors do not change.
>
> with the color editor viewable, I access color editor through the pull down menu (which does not change the color editor's position), then it works.
> Seems like I need to associate a model with the editor in the code.
> I have the model selected before I issue the commands, no difference.
I see. The above code is equivalent to doing “Tools->Utilities->Color Editor”, not clicking on a model panel color well. There is no direct hook into those color wells, so doing what you want requires some fancy footwork. Here’s my best shot:
import chimera
from chimera.tkgui import FakeWell
class ModelWell(FakeWell):
def showColor(self, color=None, multiple=False, notifyPanel=True, doCallback=True):
if multiple or not doCallback:
return
for model in mp.selected(moleculesOnly=False, groupsOkay=True):
if color == None:
model.color = None
else:
model.color = chimera.MaterialColor(*color))
mw = ModelWell()
# The ‘mp’ variable holding the model panel instance must already exist
# when activate called
mw.activate() # pops up the color editor
—Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://plato.cgl.ucsf.edu/pipermail/chimera-dev/attachments/20151015/b0435c8b/attachment.html>
More information about the Chimera-dev
mailing list