I've been trying to produce something that allows me to have multiple sentences in a line. The code is:
import wx app = wx.PySimpleApp() class MyDialog(wx.Frame): """ This is my dialog in which I have my interface. """ def __init__(self): """ This stores all my variables. """ wx.Frame.__init__(self, None, -1, "Edit Action", size=(400, 300)) self.my_mini_panels = [] self.my_mini_hboxes = [] self.my_mini_vboxes = [] self.main_vbox = wx.BoxSizer(wx.VERTICAL) self.main_hbox = wx.BoxSizer(wx.HORIZONTAL) self.my_mini_panels.append(wx.Panel(self, -1, style=wx.SIMPLE_BORDER, size=(400, 20))) self.my_mini_hboxes.append(wx.BoxSizer(wx.HORIZONTAL)) self.my_mini_vboxes.append(wx.BoxSizer(wx.VERTICAL)) self.my_mini_hboxes[0].AddMany((wx.StaticText(self.my_mini_panels[0], -1, 'Here it is... '), wx.StaticText(self.my_mini_panels[0], -1, 'There it was.'))) self.my_mini_panels.append(wx.Panel(self, -1, style=wx.SIMPLE_BORDER, size=(400, 20))) self.my_mini_hboxes.append(wx.BoxSizer(wx.HORIZONTAL)) self.my_mini_vboxes.append(wx.BoxSizer(wx.VERTICAL)) self.my_mini_hboxes[1].AddMany((wx.StaticText(self.my_mini_panels[1], -1, 'Hello, '), wx.StaticText(self.my_mini_panels[1], -1, 'Goodbye!'))) for i, hbox in enumerate(self.my_mini_hboxes): hbox.Add(self.my_mini_vboxes[i]) self.main_vbox.AddMany(tuple(self.my_mini_hboxes)) self.main_hbox.Add(self.main_vbox) self.SetSizer(self.main_hbox) if __name__ == '__main__': dialog = MyDialog() dialog.Show(True) app.MainLoop() It doesn't seem to be working. I'd like it to look like this:
What am I doing wrong?
EDIT
Perhaps I should make it clear that the static text objects must be separate. I can't just replace two segments of text on one line with one larger segment.