def text_input(prompt='', value='', title=''):
"""Provides a text input dialog and returns the user input
The value field can be used to enter the default initial value.
Example:
>> textInput('Enter your name:', title='Name')
"""
try:
dlg = wx.TextEntryDialog(None, message=prompt, caption=title, defaultValue=value)
except wx._core.PyNoAppError:
app = mzApp()
app.launch()
dlg = wx.TextEntryDialog(None, message=prompt, caption=title, defaultValue=value)
dlg.ShowModal()
output = dlg.GetValue()
dlg.Destroy()
return output
评论列表
文章目录