Re[2]: Change in wxPersistentRegisterAndRestore behaviour with wxAui
Vadim Zeitlin <[email protected]> Tue, 11 Nov 2025 18:56:49 +0100
| Newsgroups | gmane.comp.lib.wxwindows.general |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 9 Nov 2025 08:58:52 +0000 jon bird wrote:
jb> Attached is a diff which demonstrates this problem against the auidemo.
For the record, please use "diff -u" (or git-diff) to make unified diffs
which are generally preferred to the "normal" ones.
jb> All it really does is shrink down the width of the Tree Pane on the
jb> 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 3.2.7 you
jb> 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.
jb> I had a peruse of the perspective classes you directed me at yesterday,
jb> including wxAuiSerializer however I couldn't see anything obvious in
jb> the wxAuiPaneLayoutInfo structure which would be used to set the size
jb> of the pane - unless it's the dock_size attribute from
jb> 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.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
https://www.tt-solutions.com/
signature.asc
(application/pgp-signature, 195 B)
-----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQQx+vLQdOwioQqkxtoG6kHeT2wehgUCaRN44QAKCRAG6kHeT2we ht9vAJ4585LiG4SIsMPVgc/k9Epq6hnl0ACfeG0ocwdm82fkY6QB6/n+yBlQwa0= =Yxnh -----END PGP SIGNATURE-----