Changeset 3284
- Timestamp:
- 08/01/08 19:55:05 (5 years ago)
- Files:
-
- 1 modified
-
branch/PacketManipulator/widgets/Expander.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branch/PacketManipulator/widgets/Expander.py
r3283 r3284 37 37 # Requires PyGTK 2.8.0 or later 38 38 39 __all__ = ['AnimatedExpander', 'ToolBox'] 40 39 41 class Child: 40 42 widget = None … … 178 180 179 181 def do_expose_event(self, event): 182 if self._animating: 183 if not self.flags() & gtk.VISIBLE: 184 self.show() 185 else: 186 if self._to_show: 187 if not self.flags() & gtk.VISIBLE: 188 self.show() 189 else: 190 if self.flags() & gtk.VISIBLE: 191 self.hide() 192 180 193 if event.window != self._bin_window: 181 194 return False … … 444 457 self.pack_start(self._layout) 445 458 446 self.set_size_request(40, 100)447 459 self.show_all() 448 449 def do_size_allocate(self, allocation):450 # We should force a size allocate to avoid bugs451 # when the widget is getting too small!452 gtk.VBox.do_size_allocate(self, allocation)453 self._layout.size_allocate(self._layout.allocation)454 460 455 461 def do_realize(self): … … 460 466 461 467 self._happy_box.modify_bg(gtk.STATE_NORMAL, bg_color) 468 469 # Uhmma uhmma bad trick! 470 if not self._layout._to_show: 471 self._layout.hide() 462 472 463 473 def add_widget(self, widget, show=False): … … 473 483 474 484 def add(self, widget): 475 self.add_widget(widget, False) #FIXME485 self.add_widget(widget, True) 476 486 477 487 def get_label(self): … … 586 596 self.pack_start(page, False, False) 587 597 self._pages.append(page) 588 #self. set_active_page(page)598 #self._set_active_page(page) 589 599 590 600 # Private API … … 667 677 # if not ignore the page._expand and set the packing to True 668 678 669 print "yuuuuuuuuu"670 671 679 for child in self.get_children(): 672 print "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO"673 680 print self.query_child_packing(child) 674 681 … … 700 707 701 708 exp = klass("miao") 702 exp.add (sw)709 exp.add_widget(sw, False) 703 710 704 711 vbox.pack_start(exp, False, False) … … 708 715 709 716 exp = klass("miao") 710 exp.add (sw)717 exp.add_widget(sw, False) 711 718 vbox.pack_start(exp) 712 719 … … 725 732 726 733 if __name__ == "__main__": 727 #main(AnimatedExpander)734 main(AnimatedExpander) 728 735 #main(gtk.Expander) 729 736 toolbox()
