[Kde-bindings] Python Plasma.PopupApplet revisited

Arno Rehn arno at arnorehn.de
Mon Jul 5 21:38:57 UTC 2010


On Monday 05 July 2010 23:05:27 Thomas Olsen wrote:
> Hi
> 
> Inspired by Petri's example [1] I almost succeeded in creating a Python
> based PopupApplet without instantiating ExtenderItems. The only problem is
> that in order for the Applet to actually popup when clicked on in the
> panel, I have to first add it to the desktop and then drag it to the panel
> :-/
> 
> In metadata.desktop I have ServiceTypes=Plasma/PopupApplet.
> I have overloaded graphicsWidget() which creates the GUI and widget() which
> simply calls graphicsWidget(). Had to use both of them because either I got
> a TypeError or neither got called. I also had to call setGraphicsWidget()
> and setPopupIcon(). All of this works excellent but only if the Plasmoid
> was first added to the desktop.
> From reading the source of the C++ implementation [2] I can see that the
> panel-icon-widget's (or whatever it's called) clicked() signal gets
> connected to a private method internalTogglePopup() but for some reason
> that doesn't happen when it is added directly to the panel.
> 
> Am I missing something or will I have to reimplement everything in Python -
> which seems a bit silly ;-)
Make sure you set a minimum size that's larger than what fits in the panel on 
the widget() or graphicsWidget() (e.g. setMinimumSize(320, 240)). That's what 
I had done wrong first in my Ruby plasmoid and it just never worked. I think 
it's been added to the documentation now, but I'm not sure.
Apart from that I don't think that I can help that much. I'm not really into 
Python after all.

-- 
Arno Rehn
arno at arnorehn.de



More information about the Kde-bindings mailing list