~kripkenstein/topshelf/main

« back to all changes in this revision

Viewing changes to topshelf.py

  • Committer: alon
  • Date: 2008-01-21 15:31:48 UTC
  • Revision ID: alon@dignity-20080121153148-qtghp1vfd175v9l0
No tooltips (needs pygtk 2.12, which many don't have), no fail

Show diffs side-by-side

added added

removed removed

Lines of Context:
216
216
 
217
217
                self.panel_image = gtk.Image()
218
218
                self.panel_image.set_from_pixbuf(self.panel_pb)
219
 
                self.panel_image.set_tooltip_text("TopShelf")
 
219
                try:
 
220
                        self.panel_image.set_tooltip_text("TopShelf")
 
221
                except AttributeError:
 
222
                        pass # No tooltips, not the end of the world. Only python-gtk2 2.12 has them, i.e., Gutsy and above
220
223
                self.eventbox = gtk.EventBox()
221
224
                self.eventbox.connect("button-press-event", self.do_button_press)
222
225
                self.eventbox.drag_dest_set(gtk.DEST_DEFAULT_ALL, [('text/uri-list', 0, 81)], gtk.gdk.ACTION_LINK)
626
629
                btn.set_icon_widget(icon)
627
630
                btn.set_label(alt_text)
628
631
                btn.connect("clicked", callback)
629
 
                btn.set_tooltip_text(tooltip)
 
632
                try:
 
633
                        btn.set_tooltip_text(tooltip)
 
634
                except AttributeError:
 
635
                        pass # No tooltips, not the end of the world. Only python-gtk2 2.12 has them, i.e., Gutsy and above
 
636
 
630
637
                toolbar.insert(btn, -1)
631
638
 
632
639
        def add_stock_button(self, toolbar, stock_id, callback, tooltip):
633
640
                btn = gtk.ToolButton(stock_id)
634
641
                btn.connect("clicked", callback)
635
 
                btn.set_tooltip_text(tooltip)
 
642
                try:
 
643
                        btn.set_tooltip_text(tooltip)
 
644
                except AttributeError:
 
645
                        pass # No tooltips, not the end of the world. Only python-gtk2 2.12 has them, i.e., Gutsy and above
636
646
                toolbar.insert(btn, -1)
637
647
 
638
648
        def add_menuitem(self, menu, stock_id, callback):