Code:


import wx


class WindowClass(wx.Frame):

def __init__(self, parent, id):
wx.Frame.__init__(self, parent, id, '', size = (400, 400))
qpanel = wx.Panel(self)

box = wx.TextEntryDialog(None, "What is your Name? ", "Title", "default text")
if box.ShowModal() == wx.ID_OK:
answer = box.GetValue()


if __name__ == '__main__':
app = wx.PySimpleApp()
frame = WindowClass(parent=None, id=-1)
frame.Show()
app.MainLoop()




ERRORS

C:\Python27\python.exe C:/Users/Nick/SkyDrive/Documents/Projects/Python/Tkinter_2/0/WX6_Text_Boxes_Input.py
Traceback (most recent call last):
  File "C:/Users/Nick/SkyDrive/Documents/Projects/Python/Tkinter_2/0/WX6_Text_Boxes_Input.py", line 4, in
    class WindowClass(wx.Frame):
  File "C:/Users/Nick/SkyDrive/Documents/Projects/Python/Tkinter_2/0/WX6_Text_Boxes_Input.py", line 10, in WindowClass
    box = wx.TextEntryDialog(None, "What is your Name? ", "Title", "default text")
  File "C:\Python27\lib\site-packages\wx-3.0-msw\wx\_windows.py", line 3381, in __init__
    _windows_.TextEntryDialog_swiginit(self,_windows_.new_TextEntryDialog(*args, **kwargs))
wx._core.PyNoAppError: The wx.App object must be created first!

Process finished with exit code 1