Re: When is the application's FXRegistery used/read? and ~/.foxrc not read? (Linux/x86-64 recent Debian or Ubuntu)

Jeroen van der Zijp <[email protected]> Wed, 20 Sep 2023 20:39:46 -0500
Newsgroups gmane.comp.lib.fox-toolkit.user
Organization FOX Toolkit
Message-ID <20230920203946.1fe671a6@yellowstone>
On Wed, 20 Sep 2023 21:00:07 +0200
Basile Starynkevitch <[email protected]> wrote:

> Hello
> 
> Consider (for Linux, Debian/sid, x86-64 or Ubuntu 23.04) the open
> source code on https://github.com/RefPerSys/guifox-refpersys commit
> 0ac2c34
> <https://github.com/RefPerSys/guifox-refpersys/commit/0ac2c345e085107f41df5bb54f077f8b26ceedd9>
> 
> The FOX toolkit is shown by that example (rimski is my personal
> desktop, Ubuntu 23.04 Mantic Minotaur,  AMD Ryzen Threadripper 2970WX)
> 
> rimski.x86_64 ~/guifox-refpersys 20:48 .1 % ./foxrps --version
> ./foxrps version information (on rimski):
>       git 368e52da967d35a8af8ac6cadb0d14caac32ecd1+
>       built Sep 20 2023@20:26:39
>       for OS: GNU_Linux and arch x86_64
>       compiled on rimski
>       compiled for FOX 1.7.84, running 1.7.84
> 
> I don't understand why the FXRegistery is not loaded, having some
> empty $HOME/.foxrc
> 
> If I strace the process, this ~/.foxrc file is not even open-ed, why?
> 
> Regards from near Paris in France.

Typically, it loads from $HOME/.config the three files:

1) "fox.rc" for FOX-wide per-user settings

2) "vendorkey.rc" for per-user vendor-wide settings

3) "applicationkey.rc" per-user, per-application settings.


There are another 3 levels above this, for systemwide
(FOX/vendor/application) settings.  They're only useful if your
installation scripts write something there. Typically system-wide
background settings that are specific to an install; for example,
DLL locations etc).


======

For registry to get loaded, at the very least application key should
be available when FXApp is constructed. vendor key may remain the 
empty string, it is not always important unless you're making a
suite of applications that may need some common configurations.

Next, paths where FXRegistry is looking for its files.  On Linux
this is mostly standardized, following desktop standards:

We have the system-wide directory:  "/etc/xdg"

and the per-user directory: "~/.config"

Inside these, three files are attempted for load:

~/.config/fox.rc

~/.config/vendorkey.rc

~/.config/appkey.rc

where "appkey" is the application-key, and "vendorkey" is the vendor-key
passed in FXApp constructor, respectively.



=========

When is registry loaded? It is loaded when FXApp::init() is called.

The registry is written when FXApp::exit() is called.  Different
applications may decide to write registry earlier, e.g. when a
main window is closed.


Hope this helps,



   -- JVZ







_______________________________________________
Foxgui-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/foxgui-users