On Tue, 11 Nov 2025 18:56:49 +0100
Vadim Zeitlin <
va...@wxwidgets.org> wrote:
> On Sun, 9 Nov 2025 08:58:52 +0000 jon bird wrote:
>
> jb> Attached is a diff which demonstrates this problem against the
> jb> auidemo.
>
> For the record, please use "diff -u" (or git-diff) to make unified
> diffs which are generally preferred to the "normal" ones.
>
Duly noted, I was in a bit of a rush Sunday morning so it ended up
being something quickly generated on a Windows box.
> jb> All it really does is shrink down the width of the Tree Pane on
> jb> the left hand side.
>
> Yes, and I can see the difference in behaviour even without the other
> changes, so I'm not sure why they were included.
>
> jb> When built against 3.3.1, it makes no difference however with
> jb> 3.2.7 you can see the window width has been shrunk
>
> I didn't build it against 3.3.1, but when building it against trunk
> I need to use
>
> tree->SetInitialSize(wxSize(92, -1));
>
> to make this size be taken into account (or almost, see below). I
> admit that I'm puzzled by this because I don't remember any changes
> to this since 3.2, but apparently something did change. Still,
> SetInitialSize() provides a simple enough workaround.
>
> Note that the tree still won't be 92px wide in the sample because it
> won't be made smaller than its best size which is 140px on my system
> (which is roughly the length of the root item label plus the icon
> size and margins). This change is desirable because it doesn't look
> right to truncate the tree contents.
>
I can see the effect in the demo code and understand the rationale on
why it wouldn't shrink any further. Unfortunately this didn't have the
same effect with my application, the window size always reverts to it's
original size.
Here's the default layout that gets generated.
https://www.oasw.co.uk/public/bwall-original.png
Looking at it, there's plenty of space in the x direction. I would
expect the limits to be either at the point the text on the buttons at
the bottom starts to be truncated OR (possibly) the width of the
longest string in the drop down. However you can see from this:
https://www.oasw.co.uk/public/bwall-resize.png
I can manually shrink it further without hitting those limits. So
something else is imposing an artificial minimum width here.
> jb> I had a peruse of the perspective classes you directed me at
> jb> yesterday, including wxAuiSerializer however I couldn't see
> jb> anything obvious in the wxAuiPaneLayoutInfo structure which would
> jb> be used to set the size of the pane - unless it's the dock_size
> jb> attribute from wxAuiDockLayoutInfo.
>
> The idea is that you don't set any sizes manually when using
> wxAuiSerializer as it preserves the layout (and sizes) chosen by the
> user. To specify the initial size, when there is no saved layout to
> restore, you can create the windows with their desired minimum size
> or, if this is impossible for some reason, use SetInitialSize() to
> specify the minimum sizes.
>
At the moment, the only thing I'm saving is the width of the window.
What isn't clear to me looking at wxAuiSerializer is how I'd replicate
that behavior - as in which component in the structure represents the
panel width? Anything else is really "don't care" it can use the system
default.