Time to learn to write your own dialogs !; -)
Built-in dialogs, such as TextEntryDialog , are intended only for the most basic programs. If you need a lot of customization, you need to write your own dialogs.
Here is an example, this should work for you.
import wx class TextEntryDialog(wx.Dialog): def __init__(self, parent, title, caption): style = wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER super(TextEntryDialog, self).__init__(parent, -1, title, style=style) text = wx.StaticText(self, -1, caption) input = wx.TextCtrl(self, -1, style=wx.TE_MULTILINE) input.SetInitialSize((400, 300)) buttons = self.CreateButtonSizer(wx.OK|wx.CANCEL) sizer = wx.BoxSizer(wx.VERTICAL) sizer.Add(text, 0, wx.ALL, 5) sizer.Add(input, 1, wx.EXPAND|wx.ALL, 5) sizer.Add(buttons, 0, wx.EXPAND|wx.ALL, 5) self.SetSizerAndFit(sizer) self.input = input def SetValue(self, value): self.input.SetValue(value) def GetValue(self): return self.input.GetValue() if __name__ == '__main__': app = wx.PySimpleApp() dialog = TextEntryDialog(None, 'Title', 'Caption') dialog.Center() dialog.SetValue('Value') if dialog.ShowModal() == wx.ID_OK: print dialog.GetValue() dialog.Destroy() app.MainLoop()
Foglebird
source share