Get the selected tab in a enthought traits application
Hi, I have a traits application with a tabbed group: Group( Group(label="a", dock='tab'), Group(label="b", dock='tab'), layout='tabbed') Beneath the tabbed group, there is button which should perform some action depending on the selected tab. So I would like to know which of both tabs, 'a' or 'b', is selected (i.e. active). Any ideas? Thanks -- https://mail.python.org/mailman/listinfo/python-list
Re: Python GUI?
Enthought.traits !! http://code.enthought.com/projects/traits/ I started using traits a couple of months ago and I really like it. Traits provides a framework which creates a UI based on your data structures. Using some "hints" you can do anything you want. Just check out their website and try the examples. Even creating an executable out of it is quite easy using bbfreeze. The "negative" thing about is that the user group doesn't seem to be very large. In other words: if you get stuck on something, there aren't many people to help you. This however should not prevent you from using traits. Just try it and let me know what you think about it. -- https://mail.python.org/mailman/listinfo/python-list
Re: Appending data to an excel sheet by python code
Did you consider using xlrd and xlwt? I guess these package provide a solution to your problem. -- https://mail.python.org/mailman/listinfo/python-list
Re: Get the selected tab in a enthought traits application
Here's the answer: from enthought.traits.api import HasTraits, Str, List, Button, Any from enthought.traits.ui.api import View, Item from enthought.traits.ui.api import ListEditor class A(HasTraits): StringA = Str view = View(Item('StringA')) class B(HasTraits): StringB = Str view = View(Item('StringB')) class C(HasTraits): MyList = List(HasTraits) MyButton = Button(label="Test") SelectedTab = Any def _MyButton_fired(self): if self.SelectedTab == self.MyList[0]: print self.MyList[0].StringA if self.SelectedTab == self.MyList[1]: print self.MyList[1].StringB view = View(Item('MyList', style='custom', show_label=False, editor=ListEditor(use_notebook=True, deletable=False, dock_style='tab', selected='SelectedTab')), Item('MyButton', show_label=False)) a = A() b = B() c = C() c.MyList = [a, b] c.configure_traits() -- https://mail.python.org/mailman/listinfo/python-list