It's probably impossible to do exactly what you want. I suspect that
the size is not *set* until after the current event ends -- it's set
in a separate size event. You'll probably need to use wxCallAfter()
to delay the size-dependent code until after that size event has been
processed. This means that adding a page will become a
two-stage affair.
This is what I ended up doing, pity though that you can't force a size set.
By the way, it's probably not very good form to use 'win' as a global
variable. Instead, you should make it an attribute -- i.e.,def newPage(self):
self.win = wxPanel( ...)
#[...]
print self.win.GetSizeTuple()It will then be available from all methods of your frame (which I
presume is what self is, in this case).
The piece of code was just for example code purposes, I don't do this in
real code
Regards
Gerrit