I am just starting out with TraitsUI, and I am beginner Python programmer. I hope this question is not too low-level.
I want to display a button set up in ControlPanel, calling it from Main. When i do the following, i just a window with a button that says "Panel". If I click that button, i get another window with the "Start" button I want. How do i just get the window with the Start button?
Thanks, Cosmo
Main:
from enthought.traits.api import *
from enthought.traits.ui.api import *
class ControlPanel(HasTraits):
""" This object is the core of the traitsUI interface. It hosts the method for
interaction between the objects and the GUI.
"""
start = Button("Start Measurements")
view = View(Item('start', show_label=False, style='custom' ))
class MainWindow(HasTraits):
""" The main window, here go the instructions to create and destroy the application. """
panel = Instance(ControlPanel)
def _panel_default(self):
return ControlPanel()
view = View(Item('panel'))
if __name__ == '__main__':
MainWindow().configure_traits()