[chimera-dev] popup balloons with custom information for vrml models

Eric Pettersen pett at cgl.ucsf.edu
Mon Sep 12 11:05:13 PDT 2022


> On Sep 12, 2022, at 6:28 AM, Merce Alemany Chavarria via Chimera-dev <chimera-dev at cgl.ucsf.edu> wrote:
> 
> 
> Dear Chimera developers,
> 
> We are developing an extension that renders vrml models using BILD commands. For the moment the vrml models have a name that shows up on Models Panel, but when the mouse is placed on top of them only the number of model is displayed (like '#11').
> We would like to add to the models a popup balloon with customized information, in a similar way as information if shown for classical chimera objects (atoms, bonds...). 
> Could you guide us on how to approach it?

Hi Mercè,
	So the first thing I'd like to say is that this is a whole lot easier in ChimeraX, and we actively support and work on ChimeraX, whereas Chimera is legacy software so you might want to consider doing this in ChimeraX instead if possible.  Nonetheless, there is an extremely kludgy way to do this in Chimera.  It involves giving the BILD model a fake "molecule" attribute that in turn has an "oslIdent()" method that returns what you want to display in the balloon help.  So assuming your BILD model was in a variable named "b" and you wanted it to show the balloon help "B's balloon help", this would do it:

class BalloonHelp:
	def __init__(self, info):
		self.info <http://self.info/> = info

	def oslIdent(self):
		return self.info <http://self.info/>

b.molecule = BalloonHelp("B's balloon help")

> I will use this e-mail also to let you know that the link to chimera's source code (https://plato.cgl.ucsf.edu/trac/chimera/browser/trunk <https://plato.cgl.ucsf.edu/trac/chimera/browser/trunk>)  found in this page https://www.cgl.ucsf.edu/chimera/docs/sourcecode.html <https://www.cgl.ucsf.edu/chimera/docs/sourcecode.html> returns a 404 error.  Is there an alternative way to check it out?

I see no such link in that page.  The source code checkout given in that page is "svn checkout https://svn.cgl.ucsf.edu/svn/chimera/trunk chimera", which works fine for me.

--Eric

	Eric Pettersen
	UCSF Computer Graphics Lab


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.rbvi.ucsf.edu/pipermail/chimera-dev/attachments/20220912/c29ed9eb/attachment.html>


More information about the Chimera-dev mailing list