[wxMac 2.8.x] Bug in wxWindowBase::DoGetBestSize() - Help needed
Vadim Zeitlin
vadim at wxwindows.org
Thu Mar 29 07:09:26 PDT 2007
On Thu, 29 Mar 2007 15:45:06 +0200 H <H at h.com> wrote:
H> I already posted this a while ago but did not get an answer.
I can't answer this because I don't know the answer. Maybe Stefan didn't
notice this (posting to wx-dev would probably be more appropriate) or maybe
he did but didn't have time to answer it yet...
H> This is the statement causing problems:
H>
H> else if ( !GetChildren().empty()
H> #ifdef __WXMAC__
H> && wxHasRealChildren(this)
H> #endif
H> )
H>
H> There is also a remark related to "wxHasRealChildren" that "scrollbars
H> are explicitely children" on the Mac (whatever it means).
It means that under Mac the scrollbars appear in the m_children list of
wxWindow. This is highly annoying and results in all sorts of hacks in
order to exclude these scrollbars when we want to iterate over the "real"
children only.
H> Why is wxWindowBase::DoGetBestSize() returning wxSize(0, 0) if the
H> window only has scrollbars?
I don't understand why does it do it: if the window has only scrollbars,
the "else // ! has children" branch should be executed, and so the min size
should be used as the best size. And if this is not set, then we fall back
to the current/initial window size. But this should be the same under Mac
and the other platforms so the difference in behaviour doesn't come from
here apparently.
H> The real problem is that some modules assume that a window's client size
H> is zero or larger. But with this implementation of DoGetBestSize() this
H> is not the case anymore, it becomes negative!
This is clearly wrong but, once again, I don't know what is the right way
to fix it. Hopefully Stefan does...
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list