Changeset 3281
- Timestamp:
- 08/01/08 14:19:42 (5 years ago)
- Location:
- branch/PacketManipulator/widgets
- Files:
-
- 2 modified
-
Expander.py (modified) (8 diffs)
-
PropertyGrid.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branch/PacketManipulator/widgets/Expander.py
r3280 r3281 503 503 (friend of ToolBox. Don't use in other widgets) 504 504 """ 505 def __init__(self, parent, label=None, image=gtk.STOCK_PROPERTIES ):505 def __init__(self, parent, label=None, image=gtk.STOCK_PROPERTIES, expand=True): 506 506 assert(isinstance(parent, ToolBox)) 507 507 … … 509 509 510 510 self._parent = parent 511 self._ active = False511 self._expand = expand 512 512 513 513 self._layout.connect('animation-end', self.__on_end_anim) … … 573 573 # Public API 574 574 575 def append_page(self, child, txt ):576 page = ToolPage(self, txt )575 def append_page(self, child, txt=None, image=gtk.STOCK_PROPERTIES, expand=True): 576 page = ToolPage(self, txt, image, expand) 577 577 page.add_widget(child, False) 578 578 … … 602 602 children.reverse() 603 603 604 spulciato = filter(lambda x: x._expand and x._layout.get_active(), children) 605 606 if spulciato: 607 children = spulciato 608 604 609 for child in children: 605 610 if page == child or \ … … 619 624 return 620 625 626 print "nothing setted", children 621 627 self._active_page = None 622 628 623 629 def _repack(self, page): 630 if not page._expand: 631 return False 632 624 633 info = self.query_child_packing(page) 625 634 … … 636 645 return False 637 646 638 def _set_active_page(self, page=None): 639 if self._active_page: 647 def _set_active_page(self, page): 648 649 if page._expand and self._active_page: 640 650 if self._one_page: 641 651 self._set_expanded(self._active_page, False) … … 646 656 647 657 if page: 658 659 # Here we should check if there's a child with True as packing options 660 # if not ignore the page._expand and set the packing to True 661 662 print "yuuuuuuuuu" 663 664 for child in self.get_children(): 665 print "OOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO" 666 print self.query_child_packing(child) 667 668 if 1 in self.query_child_packing(child)[0:2]: 669 self.set_child_packing(page, page._expand, page._expand, 0, gtk.PACK_START) 670 return 671 672 # If we are here not True :D 648 673 self.set_child_packing(page, True, True, 0, gtk.PACK_START) 674 649 675 650 676 # Public stuff … … 686 712 box = ToolBox() 687 713 box.append_page(gtk.Label("Testing"), "miao") 688 box.append_page(gtk.Label("Testing"), "miao" )714 box.append_page(gtk.Label("Testing"), "miao", expand=False) 689 715 box.append_page(gtk.Label("Testing"), "miao") 690 716 w.add(box) -
branch/PacketManipulator/widgets/PropertyGrid.py
r3279 r3281 623 623 toolbox = ToolBox() 624 624 toolbox.append_page(self.tree, 'Protocol') 625 toolbox.append_page(sw, 'Description' )625 toolbox.append_page(sw, 'Description', expand=False) 626 626 self.pack_start(toolbox) 627 627 else:
