Hello mikerabat,
attached are two examples of how to save the window values so that they are preserved on restart.
The variant in the XReg folder uses TRegistry.
TRegistry is implemented in Lazarus so that it is cross-platform. (
https://wiki.freepascal.org/fcl-registry )
I built a small unit for it, which can write string, integer, boolean, etc. into the registry and read from it.
The whole thing works also under Linux, there registry accesses are stored automatically in the folder .config in a corresponding XML.
Advantage: the program settings are BS-specific in the "right" place and are always accessible.
The variant in the folder XIni uses TIniFile.
With this variant one can write a Ini file into any folder.
Advantage: you can save the program settings where you want.
Greetings Roland