[Pywikipedia-svn] SVN: [7210] trunk/pywikipedia/userinterfaces/wxpython_interface.py

alexsh at svn.wikimedia.org alexsh at svn.wikimedia.org
Sat Sep 5 10:38:00 UTC 2009


Revision: 7210
Author:   alexsh
Date:     2009-09-05 10:38:00 +0000 (Sat, 05 Sep 2009)

Log Message:
-----------
fix wxpy.UI().input() for current wxPy module (not complete yet)

Modified Paths:
--------------
    trunk/pywikipedia/userinterfaces/wxpython_interface.py

Modified: trunk/pywikipedia/userinterfaces/wxpython_interface.py
===================================================================
--- trunk/pywikipedia/userinterfaces/wxpython_interface.py	2009-09-04 14:27:40 UTC (rev 7209)
+++ trunk/pywikipedia/userinterfaces/wxpython_interface.py	2009-09-05 10:38:00 UTC (rev 7210)
@@ -4,15 +4,15 @@
 import sys; sys.path.append('..')
 
 import config, re, sys
-from wxPython.wx import *
+import wx
 
-        
+app = wx.App()
 
 class UI:
     def __init__(self):
         pass
-
-    def output(self, text, ):
+    
+    def output(self, text, toStdout = False):
         """
         If a character can't be displayed, it will be replaced with a
         question mark.
@@ -28,8 +28,10 @@
         question.
         """
         # TODO: hide input if password = True
-        answer = dialog = wxTextEntryDialog ( None, 'question', 'Title Here', '' )
-
+        
+        answer = wx.TextEntryDialog( None, question, question, '' )
+        answer.ShowModal()
+        print answer
 #tkSimpleDialog.askstring('title', question)
         return answer or ''
 
@@ -50,5 +52,10 @@
             answer = self.input(prompt)
             if answer.lower() in hotkeys or answer.upper() in hotkeys:
                 return answer
-ui = UI()
-print ui.input('Test?')
+
+
+if __name__ == '__main__':
+    ui = UI()
+    print ui.input('Test?')
+app.MainLoop()
+





More information about the Pywikipedia-svn mailing list