When creating custom objects to add to a sizer it says that
it expects wxWindow, wxSizer, wxSize or (w,h) for the item. How do I prep my
custom class to be able to be excepted into a sizer… do I need to have my
custom class inherit one of those…? Is that how most wx objects are first
created…? I tired to inherit the wx.Size class to my base class but it caused
other errors down the chain of my code due to inherit on top of inherit on top
of inherit… if this is the proper route to go…. Then I’ll
have to stomp out those other errors… but want to make sure I’m
going down the right path before I do all that work…
A sizer only accepts:
1. A wxWindow object
2. Another wxSizer object
3. A wxSize or a (w,h) to create a spacer
A sizer is used for laying out subwindows in a window, so,
if you are tring to add an object to a sizer this probably is a visual
object, so it must be derived at least from a wxWindow. wxWindow is the
base class for all windows and represents any visible object on screen.
What, exactly, is your custom object?
Ricardo
···
On Wed, 2006-05-03 at 01:41 +1000, Keith Lackey wrote:
When creating custom objects to add to a sizer it says that it expects
wxWindow, wxSizer, wxSize or (w,h) for the item. How do I prep my
custom class to be able to be excepted into a sizer… do I need to have
my custom class inherit one of those…? Is that how most wx objects are
first created..? I tired to inherit the wx.Size class to my base class
but it caused other errors down the chain of my code due to inherit on
top of inherit on top of inherit… if this is the proper route to go….
Then I’ll have to stomp out those other errors… but want to make sure
I’m going down the right path before I do all that work…
Keith Lackey wrote:
When creating custom objects to add to a sizer it says that it expects
wxWindow, wxSizer, wxSize or (w,h) for the item. How do I prep my custom
class to be able to be excepted into a sizer.
chances are you want to inherit from wx.Window of wx.Panel (which inherits from wx.Window)
-Chris
···
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov