PlasmaToolTipManager with Python

Benjamin Kleiner bizzl.greekdog at web.de
Wed Feb 18 19:07:08 CET 2009


On Wednesday, 18. February 2009 17:51:45 Ricardo wrote:
> Hi All,
Hi...

> I'm writing a small plasma applet with Python, i try to display a
> tooltip when the mouse passes over the plasmoid, i tried with this
> code:
>
> 	Plasma.ToolTipManager.registerWidget(self)
> 	self.toolTipData=Plasma.ToolTipContent()
> 	self.toolTipData.mainText=("prueba")
> 	self.toolTipData.subText=("eoooo 1")
> 	Plasma.ToolTipManager.setContent(self,self.toolTipData)
>
> but it didn't work, it says:
>
>    Plasma.ToolTipManager.registerWidget(self)
> TypeError: first argument of unbound method
> ToolTipManager.registerWidget() must be a ToolTipManager instance
>
> any ideas?
I stumbled about that, too ;)
You've to get the Instance ofthe ToolTipManager first, with Plasma.ToolTipManager.self() :
	Plasma.ToolTipManager.self().registerWidget(self)
	self.toolTipData=Plasma.ToolTipContent()
	self.toolTipData.mainText=("prueba")
	self.toolTipData.subText=("eoooo 1")
	Plasma.ToolTipManager.self().setContent(self,self.toolTipData)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/plasma-devel/attachments/20090218/a379ef4e/attachment.htm 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090218/a379ef4e/attachment.sig 


More information about the Plasma-devel mailing list