On Thu, 25 Feb 2021 18:29:06 +0100 Andreas Falkenhahn wrote:
AF> Is there any way to make wxListView and wxDataViewCtrl columns use a
AF> width that is proportional to the widget width?
No, there is no built-in way to do it. I thought about adding some API to
size the columns equally, as this seems like a relatively common use case,
and it could be implemented natively in the Mac version, but looking at my
own use of wxDVC I see that it's almost never as simple as that, actually,
and so finally I just keep writing ad hoc wxEVT_SIZE handlers.
AF> E.g. I want to have two columns and make each column use 50% of the
AF> widget width. When the user resizes the window, the columns' width
AF> should be adapted as well so that they will always be 50% of the widget
AF> width. Is there any inbuilt way to do this or do I need to override
AF> EVT_SIZE and then compute the new column width and set it in EVT_SIZE
AF> or how should that be done?
Yes, this is indeed exactly how it can be done.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/