def build(self): global AppRoot AppRoot = self self._init_config_dir() self.ds = datastore.Datastore() self.navdrawer = NavDrawer() self.side_panel = SidePanel() self.navdrawer.add_widget(self.side_panel) self.type_view = ComponentTypeView() self.type_view.attach_selection_callback( self._update_component_type_selection) self.main_panel = self.type_view self.navdrawer.anim_type = 'slide_above_anim' self.navdrawer.add_widget(self.main_panel) Window.bind(mouse_pos=self.on_motion) self.type_view.lookup_button.bind(on_release=self.attempt_part_lookup) self.type_view.save_button.bind(on_release=self.do_datastore_update) return self.navdrawer
def __init__(self, parent, id, title): super(MainFrame, self).__init__(parent, id, title, wx.DefaultPosition, wx.Size(800, 600)) self._load_config() self._create_menu() self._do_layout() self.Centre() self._reset() self.ds = datastore.Datastore(self.datastore_file)