[wxGTK] wxTLW not scrollable (was: segfault with Dialog)

Vadim Zeitlin vadim at wxwidgets.org
Thu Jun 21 04:22:16 PDT 2007


On Thu, 21 Jun 2007 13:21:33 +0200 Robert Roebling wrote:

RR> > Of course, there should still be no crash so we should probably add the
RR> > necessary checks to prevent it from happening -- unless there is a way of
RR> > making wxTLWs scrollable in wxGTK too? Is there, Robert?
RR> 
RR> We currently implement the scrolling logic in wxWindowGTK::Create
RR> which is not used from within wxTLW::Create.

 Yes, hence all scrolling fields in wxWindow remain at their default values
which means NULL for the pointers,

RR> It requires adding a GtkScrolllWindow underneath the client area (as it
RR> is done for wxWindowGTK) and there is no reason to say that this is not
RR> possible for wxTLW, but since we never officially supported built-in
RR> scrolling for dialogs during the last before, I see little reason to
RR> start doing so now.

 Ok. I'd just like to make sure that the code fails with an intelligible
error message instead of crashing then. What would be the best way to do
it? I see

1. Overriding SetScrollbar() &c at wxTLW level to assert and do nothing
   (in particular, not crash)

2. Adding checks that the m_scrollBar elements are non-NULL in wxWindow
   itself.

If wxTLW is the only case in which m_scrollBar[x] can be NULL, then I'd
rather do (1). But if it's possible for this to happen for the other
classes, then we should probably do (2).

 What would you advise? Thanks,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list