Advertisement
Guest User

The code

a guest
Apr 20th, 2010
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.69 KB | None | 0 0
  1. from enthought.traits.api import *
  2. from enthought.traits.ui.api import *
  3. from enthought.traits.ui.menu import Action, Menu, MenuBar
  4.  
  5. class MainHandler(Handler):
  6.    
  7.     def init(self, info):
  8.         actions = [Action(name='Load file', action='load_file'),
  9.                    Action(name='Save file', action='save_file'),
  10.                    Action(name='Save as file', action='saveas_file'), ]
  11.         info.ui.view.menubar = MenuBar(Menu(*actions, name='File'))
  12.         info.ui.updated = True
  13.        
  14. class MainWindow(HasTraits):
  15.    
  16.     a = Float
  17.     b = Float
  18.    
  19.     view = View('a', 'b')
  20.    
  21. if __name__ == '__main__':
  22.    
  23.     MainWindow().configure_traits(handler=MainHandler)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement