guard against gtk/pygtk not letting us call set_orientation() on gtk.Box

This commit is contained in:
Chris Jones 2010-05-13 09:17:30 +02:00
parent 630da9b06d
commit d12223769b
1 changed files with 4 additions and 2 deletions

View File

@ -405,12 +405,14 @@ class TabLabel(gtk.HBox):
"""Update the angle of a label"""
position = self.notebook.get_tab_pos()
if position == gtk.POS_LEFT:
self.set_orientation(gtk.ORIENTATION_VERTICAL)
if hasattr(self, 'set_orientation'):
self.set_orientation(gtk.ORIENTATION_VERTICAL)
self.label.set_angle(90)
elif position == gtk.POS_RIGHT:
self.label.set_angle(270)
else:
self.set_orientation(gtk.ORIENTATION_HORIZONTAL)
if hasattr(self, 'set_orientation'):
self.set_orientation(gtk.ORIENTATION_HORIZONTAL)
self.label.set_angle(0)
def on_close(self, _widget):