Re: XRC Sub-Classing Questions
Bryan Bulten <[email protected]>
| Newsgroups | gmane.comp.lib.wxwindows.wxnet |
|---|---|
| Message-ID | <20040527171411.590dc0d0@goliath> |
Hello, Sorry for the slow response... I'm gonna be running a marathon this weekend (my first), and have been just a little preoccupied... :-) > 1) Why are changes within the constructor ignored? The constructor is > called, but changes have no effect. Is the XRC stuff setting various > defaults after construction? The default constructor is called. After that, I believe that XRC calls wxWindow::Create to construct the window. This method is not virtual, so I'm not 100% sure how it's supposed to be propagated to the subclass. This may involve making the C# side virtual for _every_ widget that derives from wxWindow. I'll look into this. > I trapped the EVT_UPDATE_UI event and made changes in there. This > worked. I had to ensure I only made the change once. If my problem > with (1) is just how things are, we'll need to have an event or > virtual method which is called once after sub-class construction when > it is safe to make changes to the instance. This would be handled from Create. > 2) What is the easiest way of ensuring everything resizes correctly > after I make my changes? In this case the button needs to grow a bit. If it's in a wx.Sizer, usually just calling Fit() on the enclosing window, or the sizer should do it. Or am I miss-interpreting? -- Bryan Bulten http://www.bulten.ca/ http://wxnet.sourceforge.net/
signature.asc
(application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQFAtloq32WFWIzmzHgRAuZgAJ4qQEMiMiI4ZnEFWu+cdyl/5Y1i9wCfV97U 9vS3L/fN2AptJ1jN0DQu728= =PgZh -----END PGP SIGNATURE-----