Can't override OnCreateStatusBar for wxFrame

Larry Bates larry.bates at websafe.com
Mon Oct 22 07:24:55 PDT 2007


Colin McPhail wrote:
> Larry Bates <larry.bates <at> websafe.com> writes:
> 
>> I wanted to create a custom status for my frame but I couldn't 
>> get it to work. 
>> I've stripped it down to the code below.  Docs say if you override 
>> OnCreateStatusBar method of wx.Frame it will get called and you 
>> can return your custom status bar instance.  Am I doing something 
>> wrong, or is this a bug?
>>
> I might be wrong, but I believe that the technology that wraps 
> wxwidgets into wxpython doesn't cope with C++ virtual functions 
> (like OnCreateStatusBar).
> 
> Instead, in your frame's __init__ you could create an instance of your
> custom status bar and then use the frame's SetStatusBar() method to
> do the needful.
> 
>> Thanks in advance.
>> Larry
>>
> Regards,
> -- Colin

That was my "workaround" that I found after Googling for quite some time to find 
an answer.  T think it is "odd" that virtual methods like OnGetChildrenCount of 
and OnGetItemCount (virtual TreeCtrl mixin) work just fine but this one doesn't.

-Larry





More information about the wxpython-users mailing list