The resource box contains five different areas. Each of the areas, as they appear on the screen, from top to bottom will be discussed.
The Resource Line
This area at the top of the resource box shows the current resource name exactly as it would appear if you were to save it to a file or apply it.
The Widget Names and Classes
This area allows you to select exactly which widgets this resource will apply to. The area contains four lines, the first contains the name of the selected widget and all its ancestors, and the more restrictive dot ( .) separator. The second line contains less specific the Class names of each widget, and well as the less restrictive star ( *) separator. The third line contains a set of special buttons called Any Widget which will generalize this level to match any widget. The last line contains a set of special buttons called Any Widget Chain which will turn the single level into something that matches zero or more levels.
The initial state of this area is the most restrictive, using the resource names and the dot separator. By selecting the other buttons in this area you can ease the restrictions to allow more and more widgets to match the specification. The extreme case is to select all the Any Widget Chain buttons, which will match every widget in the application. As you select different buttons the tree display will update to show you exactly which widgets will be effected by the current resource specification.
Normal and Constraint Resources
The next area allows you to select the name of the normal or constraint resources you wish to set. Some widgets may not have constraint resources, so that area will not appear.
Resource Value
This next area allows you to enter the resource value. This value should be entered exactly as you would type a line into your resource file. Thus it should contain no unescaped new-lines. There are a few special character sequences for this file:
\n - This will be replaced with a newline.
\### - Where # is any octal digit. This will be replaced with a single byte that contains this sequence interpreted as an octal number. For example, a value containing a NULL byte can be stored by specifying \000.
\<new-line> - This will compress to nothing.
\\ - This will compress to a single backslash.
Command Area
This area contains several command buttons, described in this section.
Set Save File
This button allows the user to modify file that the resources will be saved to. This button will bring up a dialog box that will ask you for a filename; once the filename has been entered, either hit carriage-return or click on the okay button. To pop down the dialog box without changing the save file, click the cancel button.
Save
This button will append the resource line described above to the end of the current save file. If no save file has been set the Set Save File dialog box will be popped up to prompt the user for a filename.
Apply
This button attempts to perform a XtSetValues call on all widgets that match the resource line described above. The value specified is applied directly to all matching widgets. This behavior is an attempt to give a dynamic feel to the resource editor. Since this feature allows users to put an application in states it may not be willing to handle, a hook has been provided to allow specific applications to block these SetValues requests (see Blocking Editres Requests below).
Unfortunately due to design constraints imposed on the widgets by the X Toolkit and the Resource Manager, trying to coerce an inherently static system into dynamic behavior can cause strange results. There is no guarantee that the results of an apply will be the same as what will happen when you save the value and restart the application. This functionality is provided to try to give you a rough feel for what your changes will accomplish, and the results obtained should be considered suspect at best. Having said that, this is one of the neatest features of editres, and I strongly suggest that you play with it, and see what it can do.
Save and Apply
This button combines the Save and Apply actions described above into one button.
Popdown Resource Box
This button will remove the resource box from the display.