[pygtk] Gnome panel applet troubles

Leon Bogaert leon at tim-online.nl
Sun Nov 28 02:51:34 WST 2010


Hi all,

I'm having some troubles with how my gnome panel looks. I've attached some screenshots so you can see what I mean.
The left applet is the "hamster applet" for time tracking. The applet on the right is my applet.

As you can see in the first screenshot (Screenshot-3.png) the background of my applet is weird. The lower half is another color than the top part.
If I hover over my applet (Screenshot-5.png) the background turns bright. The hamster applet doesn't have that.

And it's even weirder when I put a label in it. Then the color of the font in the label is very dark so it's almost unreadable.

What could I be doing wrong? I don't get it.

My Applet init method:

    def __init__(self, applet, iid):
        logging.debug('__init__')

        # save the applet object
        self.applet = applet

        # determine the size to draw the icon
        size = self.applet.get_size() - 2
        
        #Get theme, find SVG icon and put it in a pixbuf
        theme = gtk.icon_theme_get_default()
        pixbuf = theme.load_icon(self.icon_name, size, gtk.ICON_LOOKUP_FORCE_SVG)
        
        #Load image
        image = gtk.image_new_from_pixbuf(pixbuf)

        # set up the applet tooltip
        self.applet.set_tooltip_text(self.title)

        self.button = gtk.Button()
        self.button.set_relief(gtk.RELIEF_NONE)
        self.button.set_image(image)

        self.button.connect('button-press-event', self.button_press)
        
        self.applet.add(self.button)
        self.applet.show_all()

Thanks in advance!

Regards,
Leon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot-3.png
Type: image/png
Size: 3357 bytes
Desc: Screenshot-3.png
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20101127/8f165da1/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot-4.png
Type: image/png
Size: 3616 bytes
Desc: Screenshot-4.png
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20101127/8f165da1/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot-5.png
Type: image/png
Size: 4639 bytes
Desc: Screenshot-5.png
URL: <http://www.daa.com.au/pipermail/pygtk/attachments/20101127/8f165da1/attachment-0002.png>


More information about the pygtk mailing list