diff options
Diffstat (limited to 'pynxc/waxy/demos/MultiChoiceDialog.py')
-rwxr-xr-x | pynxc/waxy/demos/MultiChoiceDialog.py | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/pynxc/waxy/demos/MultiChoiceDialog.py b/pynxc/waxy/demos/MultiChoiceDialog.py new file mode 100755 index 0000000..01644fb --- /dev/null +++ b/pynxc/waxy/demos/MultiChoiceDialog.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python + +from waxy import * + +class MainFrame(VerticalFrame): # frame has a sizer built in + + def Body(self): + + self.CenterOnScreen() + + self.CreateStatusBar() + self.SetStatusText("This is the statusbar") + + menubar = MenuBar(self) + menu1 = Menu(self) + menu1.Append("E&xit", self.CloseWindow, "Exit demo",hotkey="Ctrl+Q") + menubar.Append(menu1, "&File") + + + b = Button(self, "MultiChoice Dialog",self.MultiChoice,default=True) + self.AddComponent(b,border=10) + + + self.Pack() + self.SetSize((640, 480)) + + + def MultiChoice(self,event): + + + lst = [ 'apple', 'pear', 'banana', 'coconut', 'orange', 'grape', 'pineapple', + 'blueberry', 'raspberry', 'blackberry', 'snozzleberry', + 'etc', 'etc..', 'etc...' ] + + dlg = MultiChoiceDialog( self, lst, + "Pick some fruit from\nthis list", + "MultiChoiceDialog") + + + res=dlg.ShowModal() + + if res=='ok': + print "Ok: ",dlg.GetChosenItems() + + else: + print "Canceled!" + + dlg.Destroy() + + + def CloseWindow(self,event): + self.Close() + +if __name__=="__main__": + app = Application(MainFrame, title="MultiChoiceDialog") + app.Run() |