pgconsole/panedext.py
changeset 76 3a41b351b122
parent 10 f3a1b9792cc9
equal deleted inserted replaced
75:39f777341db4 76:3a41b351b122
     1 import gtk
     1 from gi.repository import Gtk
     2 
     2 
     3 
     3 
     4 class PanedExt(gtk.Paned):
     4 class PanedExt(Gtk.Paned):
     5     """Extended gtk.Paned (abstract)
     5     """Extended Gtk.Paned (abstract)
     6 
     6 
     7     set_snap1(int), set_snap2(int)
     7     set_snap1(int), set_snap2(int)
     8         set minimum size of child widget
     8         set minimum size of child widget
     9         if the handle is moved to the edge, child widget is hidden
     9         if the handle is moved to the edge, child widget is hidden
    10     """
    10     """
    21     def set_snap2(self, minpos):
    21     def set_snap2(self, minpos):
    22         self.min2 = minpos
    22         self.min2 = minpos
    23 
    23 
    24 
    24 
    25     def on_position_change(self, w, scrolltype):
    25     def on_position_change(self, w, scrolltype):
    26         if self.allocation[0] == -1:
    26         if self.get_allocation().width == -1:
    27             return False
    27             return False
    28 
    28 
    29         pos = self.get_position()
    29         pos = self.get_position()
    30         maxpos = self.get_property('max-position')
    30         maxpos = self.get_property('max-position')
    31 
    31 
    46                 return True
    46                 return True
    47 
    47 
    48         return False
    48         return False
    49 
    49 
    50 
    50 
    51 class HPanedExt(gtk.HPaned, PanedExt):
    51 class HPanedExt(Gtk.HPaned, PanedExt):
    52     def __init__(self):
    52     def __init__(self):
    53         gtk.HPaned.__init__(self)
    53         Gtk.HPaned.__init__(self)
    54         PanedExt.__init__(self)
    54         PanedExt.__init__(self)
    55 
    55 
    56 
    56 
    57 class VPanedExt(gtk.VPaned, PanedExt):
    57 class VPanedExt(Gtk.VPaned, PanedExt):
    58     def __init__(self):
    58     def __init__(self):
    59         gtk.VPaned.__init__(self)
    59         Gtk.VPaned.__init__(self)
    60         PanedExt.__init__(self)
    60         PanedExt.__init__(self)
    61 
    61