(self, name='world')
| 82 | super(MyApp, self).__init__(*args) |
| 83 | |
| 84 | def main(self, name='world'): |
| 85 | # the arguments are width - height - layoutOrientationOrizontal |
| 86 | self.mainContainer = gui.Container(width=640, height=270, margin='0px auto') |
| 87 | self.mainContainer.style['text-align'] = 'center' |
| 88 | self.image_widget = PILImageViewverWidget(width=200, height=200) |
| 89 | |
| 90 | self.menu = gui.Menu(width=620, height=30) |
| 91 | m1 = gui.MenuItem('File', width=100, height=30) |
| 92 | m11 = gui.MenuItem('Save', width=100, height=30) |
| 93 | m12 = gui.MenuItem('Open', width=100, height=30) |
| 94 | m12.onclick.do(self.menu_open_clicked) |
| 95 | m111 = gui.MenuItem('Save', width=100, height=30) |
| 96 | m111.onclick.do(self.menu_save_clicked) |
| 97 | m112 = gui.MenuItem('Save as', width=100, height=30) |
| 98 | m112.onclick.do(self.menu_saveas_clicked) |
| 99 | |
| 100 | self.menu.append(m1) |
| 101 | m1.append(m11) |
| 102 | m1.append(m12) |
| 103 | m11.append(m111) |
| 104 | m11.append(m112) |
| 105 | |
| 106 | self.mainContainer.append(self.menu) |
| 107 | self.mainContainer.append(self.image_widget) |
| 108 | |
| 109 | # returning the root widget |
| 110 | return self.mainContainer |
| 111 | |
| 112 | def menu_open_clicked(self, widget): |
| 113 | self.fileselectionDialog = gui.FileSelectionDialog('File Selection Dialog', 'Select an image file', False, '.') |
nothing calls this directly
no test coverage detected