[wxpython-users] Why can't I run this code?

David Anderson zerty.david at gmail.com
Thu May 8 13:51:14 PDT 2008


I'm trying to run this code, but it compiles, runs, and then appears
something very fast that I can't read =3D(
Can anyone help? Here is the entire app code =3D)

import wx

class MainWindow(wx.Frame):
    #Construtor
    def __init__(self, parent, id, title =3D "Test"):
        wx.Frame.__init__(self, parent, id, title, size =3D (1024,740),styl=
e =3D
wx.CLOSE_BOX |
                           wx.CAPTION |
wx.RESIZE_BORDER|wx.SYSTEM_MENU|wx.MINIMIZE_BOX|wx.CLOSE_BOX)
        menubar =3D wx.MenuBar()
        self.SetMenuBar(menubar)
        dlg =3D OrderSearch(self, -1)
        dlg.ShowModal()
        self.Centre()
        self.Fit()
        self.SetMinSize(self.GetSize())
        self.Show(True)

class OrderSearch(wx.Dialog):
    def __init__(self, parent, id):
        wx.Dialog.__init__(self, parent, id)
        #labels
        self.idST =3D wx.StaticText(self, -1, "ID", style =3D wx.ALIGN_LEFT)
        self.statusST =3D wx.StaticText(self, -1, "Status", style =3D
wx.ALIGN_LEFT)
        self.typeST =3D wx.StaticText(self, -1, "Type", style =3D wx.ALIGN_=
LEFT)
        self.id2ST =3D wx.StaticText(self, -1, "ID", style =3D wx.ALIGN_LEF=
T)
        self.galleryST =3D wx.StaticText(self, -1, "Gallery", style =3D
wx.ALIGN_LEFT)
        self.dateRangeST =3D wx.StaticText(self, -1, "Date Range", style =
=3D
wx.ALIGN_LEFT)

        #Fields
        self.idTC =3D wx.TextCtrl(self, -1)
        statusList =3D ['Status', 'to', 'be', 'chosen']
        self.statusCB =3D wx.ComboBox(self, 500, "Choose from below", (90,
50),
                         (160, -1), statusList,
                         wx.CB_DROPDOWN)
        typeList =3D ['Types', 'to', 'be', 'chosen']
        self.typeCB =3D wx.ComboBox(self, 500, "Choose from below", (90, 50=
),
                         (160, -1), typeList,
                         wx.CB_DROPDOWN)
        self.id2TC =3D wx.TextCtrl(self, -1)
        galleryList =3D ['Gallery', 'stuff', 'will', 'be', 'ordered']
        galleryList.sort()
        self.galleryCB =3D wx.ComboBox(self, 500, "Choose from below", (90,
50),
                         (160, -1), galleryList,
                         wx.CB_DROPDOWN)
        self.initialDateRange =3D wx.DatePickerCtrl(self, size=3D(120,-1),
                                style=3Dwx.DP_DROPDOWN | wx.DP_SHOWCENTURY)
        self.finalDateRange =3D wx.DatePickerCtrl(self, size=3D(120,-1),
                                style=3Dwx.DP_DROPDOWN | wx.DP_SHOWCENTURY)
        #Checkboxes
        self.idCheck =3D wx.CheckBox(self,-1)
        self.statusCheck=3D wx.CheckBox(self,-1)
        self.typeCheck =3D wx.CheckBox(self,-1)
        self.id2Check =3D wx.CheckBox(self,-1)
        self.galleryCheck =3D wx.CheckBox(self,-1)
        self.dateRangeCheck =3D wx.CheckBox(self,-1)

        #Buttons
        self.searchB =3D wx.Button(self, wx.ID_ANY, "Search")

        #Sizers
        self.fgs =3D wx.FlexGridSizer(8,3,4,4)
        items =3D [self.id, self.idTC, self.idCheck, self.statusST,
self.statusCB, self.statusCheck,
                 self.typeST, self.typeCB, self.typeCheck, self.id2ST,
self.id2TC, self.id2Check,
                 self.galleryST, self.galleryCB, self.galleryCheck,
self.dateRangeST,
                 self.initialDateRange, self.dateRangeCheck,
wx.StaticText(self, -1, ""),
                 self.finalDateRange, wx.StaticText(self, -1, ""),
wx.StaticText(self, -1, ""),
                 self.searchB, wx.StaticText(self, -1, "")]
        self.fgs.AddMany(items)
        self.SetSizer(self.fgs)
        self.Show(True)


app =3D wx.App()
MainWindow(None, -1)
app.MainLoop()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200805=
08/27f2adac/attachment.htm


More information about the wxpython-users mailing list