[pygtk] Problems with button.

Hidura hidura at gmail.com
Tue Sep 8 23:45:03 WST 2009


Hello, List i have this sub-class of a Button and make me the icon what i
pass in the button but lose the releif when the icon replace the button how
could i change that and give the relief back again.


Thanks.


##CODE
class Button(gtk.Button):
        """
    This is the constructor of the Vertical Scale.
    """

    def __init__(self):
        gtk.Button.__init__(self)
            self.gc = None  # initialized in realize-event handler
            self.width  = 0 # updated in size-allocate handler
            self.height = 0 # idem
            self.connect('size-allocate', self.on_size_allocate)
        self.icon =
'/usr/local/lib/python2.5/HidalgoP/.Logos/Buttons/add.png'




    def do_expose_event(self, event):

        self.window.draw_pixbuf(self.gc,
gtk.gdk.pixbuf_new_from_file_at_size(self.icon, 60, 60),
        0, 0, -1, -1, -1, -1, gtk.gdk.RGB_DITHER_NORMAL, 0, 0)
        self.set_relief(gtk.RELIEF_NORMAL)


        def on_size_allocate(self, widget, allocation):
            self.width = allocation.width
            self.height = allocation.height



-- 
Hidura
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20090908/74a83560/attachment.htm 


More information about the pygtk mailing list