On Fri, 4 Nov 2022 15:15:04 -0700 Kenneth Porter wrote:
KP> This was pretty easy to add.
Yes, that's the whole point -- this class makes it completely trivial to
retain the geometry and other UI state between program runs. It's a bit sad
that many people are still not aware of its existence, I should advertise
it even more than I did...
KP> I invoke this before the Show() for my main
KP> wxPersistentRegisterAndRestore(frame, "MainFrame");
KP> One problem remains: If I closed the window while it was off-screen, it
KP> gets restored that way.
Hmm, this is not supposed to happen, see the code at
KP> So is there a convenience function for repositioning a window so
KP> all four corners are visible?
No, maybe it should indeed be added to wxTLW itself and be called from the
function above instead of being done just there, as it could be more
KP> I see I also should add a "View | Default" menuitem to restore the frame
KP> to "factory settings". (I don't see an obvious method for discarding the
KP> persisted settings so that the next startup uses the defaults, but I
KP> don't see much use for that except when debugging the default layout.
KP> For now I can use regedit to kill the appropriate tree.)
Yes, some way to forget (all?) the stored settings might be useful to have
too, e.g. after a major version upgrade. PRs adding it would be welcome!
TT-Solutions: wxWidgets consultancy and technical support