- Timestamp:
- Dec 13, 2011 4:18:04 PM (14 years ago)
- Location:
- moxy/trunk/src/test
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified moxy/trunk/src/test/test5.py ¶
r708 r710 38 38 39 39 40 class MainGuiHandler ( Handler ): 41 """ Handler class to perform restructuring action when conditions are met. 42 """ 43 44 def object_axes_list_changed ( self, info ): 45 print "object_axes_list_changed" 46 print info.object.display_group 47 # 48 # Build a Group in info.object.display_group that looks like this table 49 # 50 divider = "#"*10 51 for axis in info.object.axes_list: 52 divider += " " + "#"*10 53 print divider 54 print "%10s" % "axis", 55 for axis in info.object.axes_list: 56 print " %10s" % axis.name.strip(), 57 print 58 print divider 59 print "%10s" % "number", 60 for axis in info.object.axes_list: 61 print " %10g" % axis.number, 62 print 63 print divider 64 65 def show_about(self, uinfo): 66 '''About this application ...''' 67 print """show this app's AboutBox() dialog ...""" 68 69 40 70 class Moxy(HasTraits): 41 71 ''' … … 49 79 axes_dict = DictStrList(value_trait = TestClass) 50 80 axes_dict = {} 51 for item in range(1, 6):81 for item in range(1, 5): 52 82 name = "example%d" % item 53 83 desc = 'this is example %d' % item … … 58 88 59 89 display_group = Group( 60 UItem( 'axes_dict', style = 'custom' ), 61 show_border = True, 62 scrollable = True, 63 layout = 'tabbed', 64 ), 90 UItem('axes_list', style='custom'), 91 show_border = True, 92 scrollable = True, 93 ), 65 94 66 95 status_label = Str('status:') … … 73 102 desc = "stop monitoring PVs", 74 103 action = "undo_watch") 75 AboutAction = Action(name = 'About', desc='the big advert') 104 AboutAction = Action(name = 'About', desc='the big advert', 105 action = 'show_about') 76 106 QuitAction = Action(name = 'Quit', 77 107 action = '_on_close') … … 88 118 Menu(name='Tab'), 89 119 # Help: About, -, Help 90 Menu( Separator(), HelpAction, name='Help'),120 Menu(HelpAction, Separator(), AboutAction, name='Help'), 91 121 ) 122 123 def reconstructDisplayGroup(self): 124 pass 92 125 93 126 def connect(self): … … 102 135 103 136 view = View( 137 Tabbed('axes_list'), 104 138 display_group, 105 139 title="Moxy (development) GUI", … … 110 144 StatusItem(name = 'status_msg', width = 0.5), 111 145 ], 146 handler = MainGuiHandler(), 112 147 resizable=True, 113 148 menubar = menubar, -
TabularUnified moxy/trunk/src/test/test6.py ¶
r709 r710 65 65 66 66 67 class PersonHandler ( Handler ):67 class ViewHandler ( Handler ): 68 68 """ Handler class to perform restructuring action when conditions are met. 69 69 """ … … 112 112 buttons = [ 'OK' ], 113 113 resizable = True, 114 handler = PersonHandler()114 handler = ViewHandler() 115 115 ) 116 116
Note: See TracChangeset
for help on using the changeset viewer.