#chapter Customising PCE Applications

This chapter describes PCE's interface to the X11 resource mechanism.
X11 resources specify application defaults.  They are commonly used for
the specification of user preferences on look-and-feel related aspects
of an application.

PCE's resource interface is build around class resource and a number of
methods on class object and class class.  If a PCE class <class> defines
a resource named <resource>, its value may be specified in ~/.Xdefaults
using

	Pce.<Class>.<resource>: <value>

If <object> is an instance of <class>, the value of this resource may
be requested using:

	get(<object>, resource_value, <resource>, Value).

Value is the <value> converted to the type specified with the resource.
For example, class button defines a resource names `size', specifying
the minimal size of a button.  The type of this resource is `size',
defining an instance of the PCE class size.  This resource is specified
using:

	Pce.Button.size: 100x20

And requested using:

	?- get_object(button(hello), resource_value, size, Size).

	Size = size(100, 20).

Finally, if (which is often the case) a resource defines the default
value of an instance variable and the resource has the same name as
the instance variable, all instance variables that have value @default
and an associated resource may be filled with their resource value
using `object ->obtain_resources'.

Resources are associated to classes using `class ->resource' or, when
using the Prolog class interface, using the term resource/[4,5].
#end chapter

#class resource
#end class
