def lazy_load_component_list(self, self_pointer): for i in glob.glob('Components/*.symbol'): component = gui.ListItem(i) component.onclick.do( lambda e: self.deploy_component(self_pointer, e.get_text())) self.component_list.append(component) self_pointer.canvas.append(self.component_list)
def __rebuildGUI(self): key = self.listView.get_key() self.listView.empty() for m in self._engine._modules: item = gui.ListItem(m._name) item._module = m self.listView.append(item, str(m._id)) if key != None: self.listView.select_by_key(key)
def refresh_shows_display(self): self.shows_display.empty() key=0 for index in range(self.current_showlist.length()): value= self.current_showlist.show(index)['title']+" ["+self.current_showlist.show(index)['show-ref']+"]" obj = gui.ListItem(value,width=340, height=20) self.shows_display.append(obj,key=key) key+=1 if self.current_showlist.show_is_selected(): self.shows_display.select_by_key(self.current_showlist.selected_show_index())
def display_profiles(self): self.profile_list.empty() items = os.listdir(self.pp_profiles_dir) i=0 for item in items: obj= gui.ListItem(item,width=300, height=20) self.profile_objects.append(obj) self.profile_list.append(obj,key=i) i+=1 return
def refresh_list(self): self.onchange() self.list_view.empty() with self.app.db.from_query( f'SELECT {self.field} FROM {self.table};') as cursor: data = sorted(r[0] for r in cursor.fetchall()) self.list_view.append([ gui.ListItem(v, height=HEIGHT, style={'padding': '0'}) for v in data ])
def menu_dialog_clicked(self): self.dialog = gui.GenericDialog( title='Dialog Box', message='Click Ok to transfer content to main page') self.dtextinput = gui.TextInput(200, 30) self.dtextinput.set_value('Initial Text') self.dialog.add_field_with_label('dtextinput', 'Text Input', self.dtextinput) self.dcheck = gui.CheckBox(200, 30, False) self.dialog.add_field_with_label('dcheck', 'Label Checkbox', self.dcheck) values = ('Danny Young', 'Christine Holand', 'Lars Gordon', 'Roberto Robitaille') self.dlistView = gui.ListView(200, 120) key = 0 for value in values: obj = gui.ListItem(170, 20, value) self.dlistView.append(str(key), obj) key += 1 self.dialog.add_field_with_label('dlistView', 'Listview', self.dlistView) self.ddropdown = gui.DropDown(200, 20) c0 = gui.DropDownItem(200, 20, 'DropDownItem 0') c1 = gui.DropDownItem(200, 20, 'DropDownItem 1') self.ddropdown.append('0', c0) self.ddropdown.append('1', c1) self.ddropdown.set_value('Value1') self.dialog.add_field_with_label('ddropdown', 'Dropdown', self.ddropdown) self.dspinbox = gui.SpinBox(200, 20, min=0, max=5000) self.dspinbox.set_value(50) self.dialog.add_field_with_label('dspinbox', 'Spinbox', self.dspinbox) self.dslider = gui.Slider(200, 20, 10, 0, 100, 5) self.dspinbox.set_value(50) self.dialog.add_field_with_label('dslider', 'Slider', self.dslider) self.dcolor = gui.ColorPicker(200, 20) self.dcolor.set_value('#ffff00') self.dialog.add_field_with_label('dcolor', 'Colour Picker', self.dcolor) self.ddate = gui.Date( 200, 20, ) self.ddate.set_value('2000-01-01') self.dialog.add_field_with_label('ddate', 'Date', self.ddate) self.dialog.set_on_confirm_dialog_listener(self, 'dialog_confirm') self.dialog.show(self)
def refresh_medialists_display(self): # print 'refresh medialists' self.medialists_display.empty() key=0 for index in range (len(self.medialists)): obj = gui.ListItem(self.medialists[index],width=340, height=20) self.medialists_display.append(obj,key=key) key+=1 if self.current_medialist is not None: self.medialists_display.select_by_key(self.current_medialists_index)
def open_medialists(self,profile_dir): self.medialists = [] for this_file in os.listdir(profile_dir): if this_file.endswith(".json") and this_file not in ('pp_showlist.json','schedule.json'): self.medialists = self.medialists + [this_file] self.medialists_display.empty() key=0 for index in range (len(self.medialists)): obj = gui.ListItem(self.medialists[index],width=340, height=20) self.medialists_display.append(obj, key=key) key+=1 self.current_medialists_index=-1 self.current_medialist=None
def refresh_tracks_display(self): self.tracks_display.empty() if self.current_medialist is not None: key=0 for index in range(self.current_medialist.length()): if self.current_medialist.track(index)['track-ref'] != '': track_ref_string=" ["+self.current_medialist.track(index)['track-ref']+"]" else: track_ref_string="" obj = gui.ListItem(self.current_medialist.track(index)['title']+track_ref_string,width=340, height=20) self.tracks_display.append(obj,key=key) key+=1 if self.current_medialist.track_is_selected(): self.tracks_display.select_by_key(self.current_medialist.selected_track_index())
def updateScheduler(self): scheduler = self.robot.autoScheduler self.schedulerList.empty() for line in self.robotPathLines: self.fieldSvg.remove_child(line) self.robotPathLines.clear() # the higher the line number, the older it is lineX, lineY = fieldToSvgCoordinates(self.robotArrow.x, self.robotArrow.y, self.fieldWidth, self.fieldHeight, self.fieldPixelsPerFoot) lineX2, lineY2 = lineX, lineY lineX3, lineY3 = lineX2, lineY2 index = 0 for action in scheduler.actionList: name = action.name if action == scheduler.runningAction: name = "* " + name listItem = gui.ListItem(name) self.schedulerList.append(listItem, str(index)) if action.coord is not None: if action.key == "drive": lineX3, lineY3 = lineX2, lineY2 lineX2, lineY2 = lineX, lineY lineX, lineY = self.actionLines(lineX, lineY, action.coord) elif action.key == "bezier": for coord in action.coord: lineX3, lineY3 = lineX2, lineY2 lineX2, lineY2 = lineX, lineY lineX, lineY = self.actionLines(lineX, lineY, coord) self.bezierCurve(lineX, lineX2, lineX3, lineY, lineY2, lineY3) # finishes the last point on the curve self.bezierCurve(lineX, lineX, lineX2, lineY, lineY, lineY2) index += 1 for coord in self.bezierPathLines: lineX, lineY = self.actionLines(lineX, lineY, coord)
def updateScheduler(self): scheduler = self.robot.autoScheduler self.schedulerList.empty() for line in self.robotPathLines: self.fieldSvg.remove_child(line) self.robotPathLines.clear() lineX, lineY = fieldToSvgCoordinates(self.robotArrow.x, self.robotArrow.y) index = 0 for action in scheduler.actionList: name = action.name if action == scheduler.runningAction: name = "* " + name listItem = gui.ListItem(name) self.schedulerList.append(listItem, str(index)) lineX, lineY = self.actionLines(lineX, lineY, action) index += 1
def test_init(self): widget = gui.ListItem('test list item') self.assertIn('test list item',widget.repr()) assertValidHTML(widget.repr())
def add_error(self, error): self.errors.append(gui.ListItem(error))
def initScheduler(self, robot): schedulerBox = self.sectionBox() controlBox = gui.HBox() schedulerBox.append(controlBox) manualModeBtn = gui.Button("Manual") manualModeBtn.set_on_click_listener(robot.c_manualMode) controlBox.append(manualModeBtn) autoModeBtn = gui.Button("Auto") autoModeBtn.set_on_click_listener(robot.c_autoMode) controlBox.append(autoModeBtn) self.controlModeGroup = sea.ToggleButtonGroup() self.controlModeGroup.addButton(manualModeBtn, "manual") self.controlModeGroup.addButton(autoModeBtn, "auto") hbox = gui.HBox() hbox.style['align-items'] = 'flex-start' schedulerBox.append(hbox) addActionBox = gui.VBox() hbox.append(addActionBox) addActionBox.append(gui.Label("Auto actions:")) self.genericActionList = gui.ListView() self.genericActionList.append("Drive to Point", "drive") self.genericActionList.append("Rotate in Place", "rotate") self.genericActionList.append("Rotate towards Point", "face") self.genericActionList.append("Shoot", "shoot") self.genericActionList.append("Toggle Intake", "intake") self.genericActionList.append("Set Starting Positon", "set") self.genericActionList.append("Set Robot Starting Angle", "angle") index = 0 for action in robot.genericAutoActions: self.genericActionList.append(gui.ListItem(action.name), str(index)) index += 1 self.genericActionList.set_on_selection_listener( self.c_addGenericAction) addActionBox.append(self.genericActionList) hbox.append(gui.HBox(width=10)) scheduleListBox = gui.VBox() hbox.append(scheduleListBox) clearScheduleBox = gui.HBox() clearScheduleBox.style['align-items'] = 'flex-end' scheduleListBox.append(clearScheduleBox) clearScheduleBox.append(gui.Label("Schedule:")) clearScheduleBtn = gui.Button("Clear") clearScheduleBtn.set_on_click_listener(self.c_clearSchedule) clearScheduleBox.append(clearScheduleBtn) self.schedulerList = gui.ListView() self.schedulerList.set_on_selection_listener(self.c_removeAction) scheduleListBox.append(self.schedulerList) schedulePresetLbl = gui.Label("Auto Sequence Presets") schedulerBox.append(schedulePresetLbl) presetIn = gui.Input(default_value="file name") schedulerBox.append(presetIn) schedulePresets = gui.HBox() schedulerBox.append(schedulePresets) self.presetDropdown = gui.DropDown() self.updatePresetFileDropdown() schedulerBox.append(self.presetDropdown) openPresetBtn = gui.Button("Open") schedulePresets.append(openPresetBtn) openPresetBtn.set_on_click_listener(self.c_openAutoPreset, self.presetDropdown) newPresetBtn = gui.Button("New") schedulePresets.append(newPresetBtn) newPresetBtn.set_on_click_listener(self.c_saveAutoPresetFromText, presetIn) schedulePresets.append(newPresetBtn) savePresetBtn = gui.Button("Save") schedulePresets.append(savePresetBtn) savePresetBtn.set_on_click_listener(self.c_saveAutoPresetFromDropdown, self.presetDropdown) schedulePresets.append(savePresetBtn) deletePresetBtn = gui.Button("Delete") schedulePresets.append(deletePresetBtn) deletePresetBtn.set_on_click_listener(self.c_deleteAutoPreset, self.presetDropdown) schedulePresets.append(deletePresetBtn) return schedulerBox
def append(self, data): self.stdouts.append(data) # data = data.replace("\n", "<br/>") self.lst_termout.append(gui.ListItem(data))
def initScheduler(self, robot): schedulerBox = self.sectionBox() controlBox = gui.HBox() schedulerBox.append(controlBox) manualModeBtn = gui.Button("Manual") manualModeBtn.onclick.connect(robot.c_manualMode) controlBox.append(manualModeBtn) autoModeBtn = gui.Button("Auto") autoModeBtn.onclick.connect(robot.c_autoMode) controlBox.append(autoModeBtn) self.controlModeGroup = sea.ToggleButtonGroup() self.controlModeGroup.addButton(manualModeBtn, "manual") self.controlModeGroup.addButton(autoModeBtn, "auto") hbox = gui.HBox() hbox.style['align-items'] = 'flex-start' schedulerBox.append(hbox) addActionBox = gui.VBox() hbox.append(addActionBox) self.autoSpeed = 6 def slowSpeed(): self.autoSpeed = 3 def mediumSpeed(): self.autoSpeed = 6 def fastSpeed(): self.autoSpeed = 8 speedTabBox = gui.TabBox() speedTabBox.add_tab(gui.Widget(), "Slow", slowSpeed) speedTabBox.add_tab(gui.Widget(), "Med", mediumSpeed) speedTabBox.add_tab(gui.Widget(), "Fast", fastSpeed) speedTabBox.select_by_index(1) addActionBox.append(speedTabBox) addActionBox.append(gui.Label("Auto actions:")) self.genericActionList = gui.ListView() self.genericActionList.append("Drive to Point", "drivetopoint") self.genericActionList.append("Navigate to Point", "navigatetopoint") self.genericActionList.append("Rotate in place", "rotate") index = 0 for action in robot.genericAutoActions: self.genericActionList.append(gui.ListItem(action.name), str(index)) index += 1 self.genericActionList.onselection.connect(self.c_addGenericAction) addActionBox.append(self.genericActionList) hbox.append(self.spaceBox()) scheduleListBox = gui.VBox() hbox.append(scheduleListBox) clearScheduleBox = gui.HBox() clearScheduleBox.style['align-items'] = 'flex-end' scheduleListBox.append(clearScheduleBox) clearScheduleBox.append(gui.Label("Schedule:")) clearScheduleBtn = gui.Button("Clear") clearScheduleBtn.onclick.connect(self.c_clearSchedule) clearScheduleBox.append(clearScheduleBtn) self.schedulerList = gui.ListView() self.schedulerList.onselection.connect(self.c_removeAction) scheduleListBox.append(self.schedulerList) schedulePresetLbl = gui.Label("Auto Schedule Presets") schedulerBox.append(schedulePresetLbl) presetIn = gui.Input(default_value="file name") schedulerBox.append(presetIn) schedulePresets = gui.HBox() schedulerBox.append(schedulePresets) self.presetDropdown = gui.DropDown() self.updatePresetFileDropdown() schedulerBox.append(self.presetDropdown) openPresetBtn = gui.Button("Open") schedulePresets.append(openPresetBtn) openPresetBtn.onclick.connect(self.c_openAutoPreset, self.presetDropdown) newPresetBtn = gui.Button("New") schedulePresets.append(newPresetBtn) newPresetBtn.onclick.connect(self.c_saveAutoPresetFromText, presetIn) schedulePresets.append(newPresetBtn) savePresetBtn = gui.Button("Save") schedulePresets.append(savePresetBtn) savePresetBtn.onclick.connect(self.c_saveAutoPresetFromDropdown, self.presetDropdown) schedulePresets.append(savePresetBtn) deletePresetBtn = gui.Button("Delete") schedulePresets.append(deletePresetBtn) deletePresetBtn.onclick.connect(self.c_deleteAutoPreset, self.presetDropdown) schedulePresets.append(deletePresetBtn) return schedulerBox
def main(self): verticalContainer = gui.Widget(640, 680, gui.Widget.LAYOUT_VERTICAL, 10) horizontalContainer = gui.Widget(620, 620, gui.Widget.LAYOUT_HORIZONTAL, 10) subContainerLeft = gui.Widget(340, 530, gui.Widget.LAYOUT_VERTICAL, 10) self.img = gui.Image(100, 100, './res/logo.png') self.table = gui.Table(300, 200) row = gui.TableRow() item = gui.TableTitle() item.append(str(id(item)), 'ID') row.append(str(id(item)), item) item = gui.TableTitle() item.append(str(id(item)), 'First Name') row.append(str(id(item)), item) item = gui.TableTitle() item.append(str(id(item)), 'Last Name') row.append(str(id(item)), item) self.table.append(str(id(row)), row) self.add_table_row(self.table, '101', 'Danny', 'Young') self.add_table_row(self.table, '102', 'Christine', 'Holand') self.add_table_row(self.table, '103', 'Lars', 'Gordon') self.add_table_row(self.table, '104', 'Roberto', 'Robitaille') self.add_table_row(self.table, '105', 'Maria', 'Papadopoulos') # the arguments are width - height - layoutOrientationOrizontal subContainerRight = gui.Widget(240, 560, gui.Widget.LAYOUT_VERTICAL, 10) self.lbl = gui.Label(200, 30, 'This is a LABEL!') self.bt = gui.Button(200, 30, 'Press me!') # setting the listener for the onclick event of the button self.bt.set_on_click_listener(self, 'on_button_pressed') self.txt = gui.TextInput(200, 30) self.txt.set_text('This is a TEXTAREA') self.txt.set_on_change_listener(self, 'on_text_area_change') self.spin = gui.SpinBox(200, 30, 100) self.spin.set_on_change_listener(self, 'on_spin_change') self.btInputDiag = gui.Button(200, 30, 'Open InputDialog') self.btInputDiag.set_on_click_listener(self, 'open_input_dialog') self.btFileDiag = gui.Button(200, 30, 'File Selection Dialog') self.btFileDiag.set_on_click_listener(self, 'open_fileselection_dialog') self.btUploadFile = gui.FileUploader(200, 30, './') self.btUploadFile.set_on_success_listener(self, 'fileupload_on_success') self.btUploadFile.set_on_failed_listener(self, 'fileupload_on_failed') self.listView = gui.ListView(300, 120) self.listView.set_on_selection_listener(self, "list_view_on_selected") li0 = gui.ListItem(279, 20, 'Danny Young') li1 = gui.ListItem(279, 20, 'Christine Holand') li2 = gui.ListItem(279, 20, 'Lars Gordon') li3 = gui.ListItem(279, 20, 'Roberto Robitaille') self.listView.append('0', li0) self.listView.append('1', li1) self.listView.append('2', li2) self.listView.append('3', li3) self.dropDown = gui.DropDown(200, 20) c0 = gui.DropDownItem(200, 20, 'DropDownItem 0') c1 = gui.DropDownItem(200, 20, 'DropDownItem 1') self.dropDown.append('0', c0) self.dropDown.append('1', c1) self.dropDown.set_on_change_listener(self, 'drop_down_changed') self.dropDown.set_value('DropDownItem 0') self.slider = gui.Slider(200, 20, 10, 0, 100, 5) self.slider.set_on_change_listener(self, 'slider_changed') self.colorPicker = gui.ColorPicker(200, 20, '#ffbb00') self.colorPicker.set_on_change_listener(self, 'color_picker_changed') self.date = gui.Date(200, 20, '2015-04-13') self.date.set_on_change_listener(self, 'date_changed') # appending a widget to another, the first argument is a string key subContainerRight.append('1', self.lbl) subContainerRight.append('2', self.bt) subContainerRight.append('3', self.txt) subContainerRight.append('4', self.spin) subContainerRight.append('5', self.btInputDiag) subContainerRight.append('5_', self.btFileDiag) subContainerRight.append( '5__', gui.FileDownloader(200, 30, 'download test', '../remi/res/logo.png')) subContainerRight.append('5___', self.btUploadFile) subContainerRight.append('6', self.dropDown) subContainerRight.append('7', self.slider) subContainerRight.append('8', self.colorPicker) subContainerRight.append('9', self.date) self.subContainerRight = subContainerRight subContainerLeft.append('0', self.img) subContainerLeft.append('1', self.table) subContainerLeft.append('2', self.listView) horizontalContainer.append('0', subContainerLeft) horizontalContainer.append('1', subContainerRight) menu = gui.Menu(620, 30) m1 = gui.MenuItem(100, 30, 'File') m2 = gui.MenuItem(100, 30, 'View') m2.set_on_click_listener(self, 'menu_view_clicked') m11 = gui.MenuItem(100, 30, 'Save') m12 = gui.MenuItem(100, 30, 'Open') m12.set_on_click_listener(self, 'menu_open_clicked') m111 = gui.MenuItem(100, 30, 'Save') m111.set_on_click_listener(self, 'menu_save_clicked') m112 = gui.MenuItem(100, 30, 'Save as') m112.set_on_click_listener(self, 'menu_saveas_clicked') menu.append('1', m1) menu.append('2', m2) m1.append('11', m11) m1.append('12', m12) m11.append('111', m111) m11.append('112', m112) verticalContainer.append('0', menu) verticalContainer.append('1', horizontalContainer) # returning the root widget return verticalContainer
def main(self): verticalContainer = gui.Widget(640, 900, gui.Widget.LAYOUT_VERTICAL, 10) horizontalContainer = gui.Widget(620, 620, gui.Widget.LAYOUT_HORIZONTAL, 10) subContainerLeft = gui.Widget(340, 530, gui.Widget.LAYOUT_VERTICAL, 10) self.img = gui.Image(100, 100, '/res/logo.png') self.img.set_on_click_listener(self, 'on_img_clicked') self.table = gui.Table(300, 200) self.table.from_2d_matrix([['ID', 'First Name', 'Last Name'], ['101', 'Danny', 'Young'], ['102', 'Christine', 'Holand'], ['103', 'Lars', 'Gordon'], ['104', 'Roberto', 'Robitaille'], ['105', 'Maria', 'Papadopoulos']]) # the arguments are width - height - layoutOrientationOrizontal subContainerRight = gui.Widget(240, 560, gui.Widget.LAYOUT_VERTICAL, 10) self.count = 0 self.counter = gui.Label(200, 30, '') self.lbl = gui.Label(200, 30, 'This is a LABEL!') self.bt = gui.Button(200, 30, 'Press me!') # setting the listener for the onclick event of the button self.bt.set_on_click_listener(self, 'on_button_pressed') self.txt = gui.TextInput(200, 30) self.txt.set_text('This is a TEXTAREA') self.txt.set_on_change_listener(self, 'on_text_area_change') self.spin = gui.SpinBox(200, 30, 100) self.spin.set_on_change_listener(self, 'on_spin_change') self.check = gui.CheckBoxLabel(200, 30, 'Label checkbox', True) self.check.set_on_change_listener(self, 'on_check_change') self.btInputDiag = gui.Button(200, 30, 'Open InputDialog') self.btInputDiag.set_on_click_listener(self, 'open_input_dialog') self.btFileDiag = gui.Button(200, 30, 'File Selection Dialog') self.btFileDiag.set_on_click_listener(self, 'open_fileselection_dialog') self.btUploadFile = gui.FileUploader(200, 30, './') self.btUploadFile.set_on_success_listener(self, 'fileupload_on_success') self.btUploadFile.set_on_failed_listener(self, 'fileupload_on_failed') self.listView = gui.ListView(300, 120) self.listView.set_on_selection_listener(self, "list_view_on_selected") li0 = gui.ListItem(279, 20, 'Danny Young') li1 = gui.ListItem(279, 20, 'Christine Holand') li2 = gui.ListItem(279, 20, 'Lars Gordon') li3 = gui.ListItem(279, 20, 'Roberto Robitaille') self.listView.append('0', li0) self.listView.append('1', li1) self.listView.append('2', li2) self.listView.append('3', li3) self.link = gui.Link(200, 20, "http://localhost:8081", "A link to here") self.dropDown = gui.DropDown(200, 20) c0 = gui.DropDownItem(200, 20, 'DropDownItem 0') c1 = gui.DropDownItem(200, 20, 'DropDownItem 1') self.dropDown.append('0', c0) self.dropDown.append('1', c1) self.dropDown.set_on_change_listener(self, 'drop_down_changed') self.dropDown.set_value('DropDownItem 0') self.slider = gui.Slider(200, 20, 10, 0, 100, 5) self.slider.set_on_change_listener(self, 'slider_changed') self.colorPicker = gui.ColorPicker(200, 20, '#ffbb00') self.colorPicker.set_on_change_listener(self, 'color_picker_changed') self.date = gui.Date(200, 20, '2015-04-13') self.date.set_on_change_listener(self, 'date_changed') self.video = gui.VideoPlayer( 480, 270, 'http://www.w3schools.com/tags/movie.mp4', 'http://www.oneparallel.com/wp-content/uploads/2011/01/placeholder.jpg' ) # appending a widget to another, the first argument is a string key subContainerRight.append('0', self.counter) subContainerRight.append('1', self.lbl) subContainerRight.append('2', self.bt) subContainerRight.append('3', self.txt) subContainerRight.append('4', self.spin) subContainerRight.append('checkbox', self.check) subContainerRight.append('5', self.btInputDiag) subContainerRight.append('5_', self.btFileDiag) subContainerRight.append( '5__', gui.FileDownloader(200, 30, 'download test', '../remi/res/logo.png')) subContainerRight.append('5___', self.btUploadFile) subContainerRight.append('6', self.dropDown) subContainerRight.append('7', self.slider) subContainerRight.append('8', self.colorPicker) subContainerRight.append('9', self.date) self.subContainerRight = subContainerRight subContainerLeft.append('0', self.img) subContainerLeft.append('1', self.table) subContainerLeft.append('2', self.listView) subContainerLeft.append('3', self.link) subContainerLeft.append('4', self.video) horizontalContainer.append('0', subContainerLeft) horizontalContainer.append('1', subContainerRight) menu = gui.Menu(620, 30) m1 = gui.MenuItem(100, 30, 'File') m2 = gui.MenuItem(100, 30, 'View') m2.set_on_click_listener(self, 'menu_view_clicked') m11 = gui.MenuItem(100, 30, 'Save') m12 = gui.MenuItem(100, 30, 'Open') m12.set_on_click_listener(self, 'menu_open_clicked') m111 = gui.MenuItem(100, 30, 'Save') m111.set_on_click_listener(self, 'menu_save_clicked') m112 = gui.MenuItem(100, 30, 'Save as') m112.set_on_click_listener(self, 'menu_saveas_clicked') m3 = gui.MenuItem(100, 30, 'Dialog') m3.set_on_click_listener(self, 'menu_dialog_clicked') menu.append('1', m1) menu.append('2', m2) menu.append('3', m3) m1.append('11', m11) m1.append('12', m12) m11.append('111', m111) m11.append('112', m112) menubar = gui.MenuBar(620, 30) menubar.append('1', menu) verticalContainer.append('0', menubar) verticalContainer.append('1', horizontalContainer) # kick of regular display of counter self.display_counter() # returning the root widget return verticalContainer