Changeset 346 for trunk/plugins

Show
Ignore:
Timestamp:
12/27/04 22:07:01 (4 years ago)
Author:
asterix
Message:

if no image, do not print errors

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/plugins/gtkgui/gtkgui.py

    r333 r346  
    125125                elif self.image.get_storage_type() == gtk.IMAGE_PIXBUF: 
    126126                        pix = self.image.get_pixbuf() 
    127                 if pix: 
    128                         window.draw_pixbuf(widget.style.black_gc, pix, \ 
    129                                 draw_rect.x-pix_rect.x, draw_rect.y-pix_rect.y, draw_rect.x, \ 
    130                                 draw_rect.y+2, draw_rect.width, draw_rect.height, \ 
    131             gtk.gdk.RGB_DITHER_NONE, 0, 0) 
     127                else: 
     128                        return 
     129                window.draw_pixbuf(widget.style.black_gc, pix, \ 
     130                        draw_rect.x-pix_rect.x, draw_rect.y-pix_rect.y, draw_rect.x, \ 
     131                        draw_rect.y+2, draw_rect.width, draw_rect.height, \ 
     132                        gtk.gdk.RGB_DITHER_NONE, 0, 0) 
    132133 
    133134        def on_get_size(self, widget, cell_area): 
     
    137138                elif self.image.get_storage_type() == gtk.IMAGE_PIXBUF: 
    138139                        pix = self.image.get_pixbuf() 
     140                else: 
     141                        return 0, 0, 0, 0 
    139142                pixbuf_width  = pix.get_width() 
    140143                pixbuf_height = pix.get_height()