Package: gio

Accessor g-application-resource-base-path

Lambda List

g-application-resource-base-path (object)

Syntax

(g-application-resource-base-path object) => path
(setf (g-application-resource-base-path object) path)

Arguments

object -- a g-application instance
path -- a string with the resource base path to use

Details

Accessor of the resource-base-path slot of the g-application class.

The g-application-resource-base-path slot access function gets the resource base path of the application. The (setf g-application-resource-base-path) slot access function sets or unsets the resource base path.

The resource base path is used to automatically load various application resources such as menu layouts and action descriptions. The various types of resources will be found at fixed names relative to the given resource base path. By default, the resource base path is determined from the application ID by prefixing '/' and replacing each '.' with '/'. This is done at the time that the g-application instance is constructed. Changes to the application ID after that point will not have an impact on the resource base path.

As an example, if the application has an ID of "org.example.app" then the default resource base path will be "/org/example/app". If this is a gtk-application instance, and you have not manually changed the resource base path, then GTK will then search for the menus of the application at "/org/example/app/gtk/menus.ui". See the g-resource documentation for more information about adding resources to your application. You can disable automatic resource loading functionality by setting the resource base path to nil.

Changing the resource base path once the application is running is not recommended. The point at which the resource base path is consulted for forming paths for various purposes is unspecified. When writing a subclass of the g-application class you should either set the resource-base-path property at construction time, or call this function during the instance initialization.
 

See also

*2021-10-13