Widget Resources

The widgets are objects and they have resources, also called attributes. These can be set at creation time by passing the list of attributes as an argument to the predicate that creates the widget or in later time by calling xtSetValues/2. In the example above the third argument of xmCreatePushButton/4 is the attribute list and the size of the push button is set initially to 100x100 pixels. If that argument was an empty list then no attributes would have been set. Each attribute is represented as a term whose functor is its resource name and whose argument is its value. In pxt-wid all of the resources are listed with the types of their values.

There is a method to inspect the values of the attributes. This can be accomplished using the predicate xtGetValues/2, which is almost the same as xtSetValues/2 except that the argument of the attribute term is a variable, which is to be bound as a result of the call with the value of the attribute. For example to inspect the size of the push button from the previous example call:

     xtGetValues(Button, [xmNwidth(X), xmNheight(Y)]).

At last, a word of caution. Not all resources can be set at creation time or set/get at a later time. To check for that look at the Motif and X Toolkit manuals.