Exemplo n.º 1
0
 def add_widget(self, widget, tab=None):
     if tab is None:
         if not hasattr(widget, 'tab'):
             raise Exception('Widget added without tab information')
         else:
             tab = widget.tab
     button = MTButton(label=tab, size=(120, 40))
     button.tab_container = self
     button.connect('on_release', curry(self.select, tab))
     self.topbar.add_widget(button)
     self.tabs[tab] = (button, widget)
Exemplo n.º 2
0
 def add_widget(self, widget, tab=None):
     if tab is None:
         if not hasattr(widget, 'tab'):
             raise Exception('Widget added without tab information')
         else:
             tab = widget.tab
     button = MTButton(label=tab, size=(120, 40))
     button.tab_container = self
     button.connect('on_release', curry(self.select, tab))
     self.topbar.add_widget(button)
     self.tabs[tab] = (button, widget)