From jlp765 at gmail.com Sat Jan 17 02:17:42 2015 From: jlp765 at gmail.com (James Parkinson) Date: Sat, 17 Jan 2015 11:17:42 +1000 Subject: [Pygui] Alerts.confirm error Message-ID: Newbie here, so apologies for the obvious, but am I doing something wrong? The following traceback and happens when Alerts.confirm() is called running on win7 Python 2.7.6 (default, Nov 10 2013, 19:24:18) [MSC v.1500 32 bit (Intel)] on win32 ----------------------------------- Traceback (most recent call last): File "C:\Python27\lib\site-packages\GUI\Component.py", line 232, in _win_event_message pass_message = not self._event_custom_handled(event) File "C:\Python27\lib\site-packages\GUI\MessageHandler.py", line 112, in _event_custom_handled self.handle_event(event) File "C:\Python27\lib\site-packages\GUI\MessageHandler.py", line 40, in handle_event self.handle(event.kind, event) File "C:\Python27\lib\site-packages\GUI\MessageHandler.py", line 59, in handle method(*args) File "C:\Python27\lib\site-packages\GUI\ButtonBases.py", line 24, in key_up GControl.key_down(self, event) NameError: global name 'GControl' is not defined --------------------------------- from GUI import Application, Window, Label, Button, TextField, Task, Grid, Alerts class MyApp(Application): def __init__(self): Application.__init__(self, title="MyApp") self.make_window() def make_window(self): self.win = Window(size = (400, 400)) self.add_widgets(self.win) self.win.show() def add_widgets(self, w): self.label1 = Label("Type some text:") self.TField1 = TextField() self.label2 = Label("Press to exit ->") self.quit_button = Button("Quit", action = "do_quit", enabled = False) self.grid = Grid([[self.label1, self.TField1],[self.label2,self.quit_button]], row_spacing=5, column_spacing=5, align="c", padding=(5,5)) w.add(self.grid) self.timer = Task(self.enable_quit_button, 2) def enable_quit_button(self): self.quit_button.enabled = True def do_quit(self): if Alerts.confirm("Exit now?") == 1: self.win.destroy() if __name__ == '__main__': MyApp().run() -------------- next part -------------- An HTML attachment was scrubbed... URL: From jlp765 at gmail.com Sat Jan 17 03:48:48 2015 From: jlp765 at gmail.com (James Parkinson) Date: Sat, 17 Jan 2015 12:48:48 +1000 Subject: [Pygui] Alerts.confirm error In-Reply-To: References: Message-ID: Answered this myself: It is a known issue https://mail.python.org/pipermail//pygui/2014-February/000266.html https://mail.python.org/pipermail//pygui/2011-November/000208.html -------------- next part -------------- An HTML attachment was scrubbed... URL: