Python Plasma.PopupApplet revisited

Thomas Olsen tanghus at gmail.com
Tue Jul 6 00:26:37 CEST 2010


On Monday 05 July 2010 23:38:57 Arno Rehn wrote:
> 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.

Yes it has been added to the docs. I set the minimumSize to the sizeHint of 
the layout used in the popupApplet and that part should work because in the 
panel it shows the icon that I set using setPopupIcon().

> Apart from that I don't think that I can help that much. I'm not really
> into Python after all.

Thanks for trying :-)

-- 
Best Regards / Med venlig hilsen

Thomas Olsen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20100706/a3ba80e9/attachment.sig 


More information about the Plasma-devel mailing list