Re: proposal: built-in gtk's support for ability to specify alternative gtkrc files to load using commandline switch



Vlad Harchev <hvv@hippo.ru> writes:

>  I think it would be nice if all gtk applications supported (due to builtin
> support in gtk_init()) a commandline switch named something like --gtkrc, that
> has a parameter - the list of gtkrc files to load. It's easy to implement
> (just call gtk_rc_set_default_files() or gtk_rc_add_default_file()), but makes
> all gtk apps more flexible.
> 
>  To be elaborate, I propose one variant of the syntax for the parameter to
> that commandline switch:
> 
>  The parameter is comma separated list of gtkrc filenames (not colon since
> it's used in pathname on Win32). If the 1st item of the list of filenames is
> plain dot ".", then it has the special meaning - the filelist will be added to
> the set of gtk rc files to be parsed, rather than replacing it entirely.
> Otherwise (if 1st element in the path is not plain dot), the list of default
> gtkrc files is replaced with the specified.
> 
>  Also, I think ability to read some environmental variable (like GTKRCS) whose
> value obeys the same syntax would be a plus IMO (since it allows to request
> loading different set of gtkrc files withour changing commandlines of
> applications).

>From gtkrc.c:

  var = g_getenv("GTK_RC_FILES");
  if (var)
    {
      files = g_strsplit (var, G_SEARCHPATH_SEPARATOR_S, 128);
      i=0;
      while (files[i])
	{
	  gtk_rc_add_default_file (files[i]);
	  i++;
	}
      g_strfreev (files);
    }

(SEARCHPATH_SEPARATOR is ':' on unix and ';' on Win32)

I don't really see a point in the command line argument, but if there
is a problem it solves, it could be added.

Regards,
                                        Owen         





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]