<object class="MyBluePanel" name="MyPanel">
<size>200,100</size>
- <object class="wxStaticText" name="lable1">
+ <object class="wxStaticText" name="label1" subclass="wxPython.wx.wxPreStaticText">
<label>This blue panel is a class derived from wxPanel,\nand is loaded by a custom wxXmlResourceHandler.</label>
<pos>10,10</pos>
</object>
# silly example. It could just as easily have been done in
# the resource.
self.SetBackgroundColour("BLUE")
+ self.SetForegroundColour("WHITE")
# To do it the more complex way, (see below) we need to write the
def Create(self, parent, id, pos, size, style, name):
wxPanel.Create(self, parent, id, pos, size, style, name)
self.SetBackgroundColour("BLUE")
+ self.SetForegroundColour("WHITE")
+
#----------------------------------------------------------------------
# instance, then you can make the handle much simpler. I'll
# show both methods below.
- if 0:
+ if 1:
# The simple method assumes that there is no existing
# instance. Be sure of that with an assert.
assert self.GetInstance() is None
sizer.Add(panel, 1, wxEXPAND|wxALL, 5)
self.SetSizer(sizer)
- self.SetAutoLayout(true)
+ self.SetAutoLayout(True)
#----------------------------------------------------------------------