gizmos.TreeCtrl question

Alle lunedì 25 febbraio 2008, Robin Dunn ha scritto:

To double check the client size issue try using the widget inspection
tool and look at the scrolled window component of the TLC at runtime.
In my tests with the demo it is showing a client size smaller than the
window size after I've expanded some items and the scrollbar appears.

This might be one of those cases where the wx.CallAfter happens too
soon. IOW, the scrolled window's client size may not be getting
adjusted until after the CallAfter callback is called. If you can't
find a more appropriate event handler to invoke this code from then one
way around this is to use a short timer instead (or wx.CallLater).

Thanks Robin.

I have tried with CallLater but the result does not look nice on MSW,
repainting is flashy even with high times (1000 msec)

I also tried by adding the call after an EVT_PAINT handler, but this caused a
repaint loop in some conditions

Found a more satisfying solution by adding wx.ALWAYS_SHOW_SB to the
TreeListCtrl parameters, it's not so nice to look at but saves (I will reuse
the same treectrl widget in other places and to me it's comfy to have such a
widget where you can play with the proportions as you do with the sizers)

This change causes a problem on Linux since the scrollbars are not updated
after the items are expanded but it's not an issue right now as the app will
be used mostly in Windows.

Is that a bug?

···

--
Cordialmente

Stefano Bartaletti
Responsabile Software

G.Tosi Spa Tintoria

Skype account: stefano.bartaletti
ICQ contact : 1271960

Viale dell'Industria 61
21052 Busto Arsizio (VA)

Tel. +39 0331 34 48 11
Fax +39 0331 35 21 23