editres - a dynamic resource editor for X Toolkit applications
command accepts all of the standard X
Toolkit command line options (see
X(1X)). The order of the command
line options is not important.
is a tool that allows users and application
developers to view the full widget hierarchy of any X Toolkit application
that speaks the
protocol. In addition
will help the user construct resource specifications, allow
the user to apply the resource to the application and view the results dynamically.
Once the user is happy with a resource specification
will append the resource string to the user's X Resources file.
Editres provides a window consisting of the following four areas: A set of popup menus that allow you full access to editres's features. The panner allows a more intuitive way to scroll the application tree display. Displays information to the user about the action that editres expects of her. This area will be used to display the selected application's widget tree.
To begin an editres session select the Get Widget Tree menu item from the command menu. This will change the pointer cursor to cross hair. You should now select the application you wish look at by clicking on any of its windows. If this application understands the editres protocol then editres will display the application's widget tree in its tree window. If the application does not understand the editres protocol editres will inform you of this fact in the message area after a few seconds delay.
Once you have a widget tree you may now select any of the other menu
options. The effect of each of these is described below.
Allows the user to click on any application that speaks the editres protocol and receive its widget tree. Editres only knows about the widgets that exist at the present time. Many applications create and destroy widgets on the fly. Selecting this menu item will cause editres to ask the application to resend its widget tree, thus updating its information to the new state of the application.
The Tree menu contains several commands that allow operations to be performed on the widget tree. This menu item allows you to select any widget in the application; editres will then highlight the corresponding element the widget tree display. Once this menu item is selected the pointer cursor will again turn to a crosshair, and you must click any pointer button in the widget you wish to have displayed. Since some widgets are fully obscured by their children, it is not possible to get to every widget this way, but this mechanism does give very useful feedback between the elements in the widget tree and those in the actual application. These functions allow the user to select, unselect, or invert all widgets in the widget tree. These functions select the immediate parent or children of each of the currently selected widgets. These functions select all parents or children of each of the currently selected widgets. This is a recursive search. When the tree widget is initially displayed the labels of each widget in the tree correspond to the widget names. These functions will cause the label of all widgets in the tree to be changed to show the class name, IDs, or window associated with each widget in the application. The widget IDs, and windows are shown as hex numbers. In the case of 64 bit addressing these hex numbers will only be the lower 32 bits of the widget's ID.
|N||Show Widget Names||Relabel(name)|
|C||Show Class Names||Relabel(class)|
|I||Show Widget IDs||Relabel(id)|
|W||Show Widget Windows||Relabel(window)|
|T||Toggle Widget/Class name||Relabel(toggle)|
The resource box contains five different areas. Each of the areas, as they appear on the screen, from top to bottom will be discussed. 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. 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 editres protocol has been built into the Athena Widget set. This allows all applications that are linked against Xaw to be able to speak to the resource editor. While this provides great flexibility, and is a useful tool, it can quite easily be abused. It is therefore possible for any Xaw application to specify a value for the editresBlock resource described below, to keep editres from divulging information about its internals, or to disable the SetValues part of the protocol. Specifies which type of blocking this application wishes to impose on the editres protocol.
The accepted values are: Block all requests. Block all SetValues requests. As this is the only editres request that actually modifies the application, this is in effect stating that the application is read-only. Allow all editres requests.
Remember that these resources are set on any Xaw application,
editres. They allow individual applications
to keep all or some of the requests
ever succeeding. Of course,
is also an Xaw application,
so it may also be viewed and modified by
recursive, I know), these commands can be blocked by setting the
the available application resources are:
Specifies the number of times the widgets in the application
will be flashed when the
Show Active Widgets
Amount of time between the flashes described above.
Specifies the color used to flash application widgets. A
bright color should be used that will immediately draw your attention to the
area being flashed, such as red or yellow.
This is the file the resource line will be append to when
button activated in the resource box.
In order to specify resources, it is useful to know the hierarchy of the widgets which compose editres. In the notation below, indentation indicates hierarchical structure. The widget class name is given first, followed by the widget instance name.
Editres editres Paned paned Box box MenuButton commands SimpleMenu menu SmeBSB sendTree SmeBSB refreshTree SmeBSB dumpTreeToFile SmeLine line SmeBSB getResourceList SmeLine line SmeBSB quit MenuButton treeCommands SimpleMenu menu SmeBSB showClientWidget SmeBSB selectAll SmeBSB unselectAll SmeBSB invertAll SmeLine line SmeBSB selectChildren SmeBSB selectParent SmeBSB selectDescendants SmeBSB selectAncestors SmeLine line SmeBSB showWidgetNames SmeBSB showClassNames SmeBSB showWidgetIDs SmeBSB showWidgetWindows SmeLine line SmeBSB flashActiveWidgets Paned hPane Panner panner Label userMessage Grip grip Porthole porthole Tree tree Toggle <name of widget in application> . . . TransientShell resourceBox Paned pane Label resourceLabel Form namesAndClasses Toggle dot Toggle star Toggle any Toggle name Toggle class . . . Label namesLabel List namesList Label constraintLabel List constraintList Form valueForm Label valueLabel Text valueText Box commandBox Command setFile Command save Command apply Command saveAndApply Command cancel Grip grip Grip grip
to get the default host and display number.
to get the name of a resource file that overrides the global
resources stored in the RESOURCE_MANAGER property.
This is a prototype, there are lots of nifty features I would love to
add, but I hope this will give you some ideas about what a resource editor
specifies required resources
Athena Widget Set
Chris D. Peterson, formerly MIT X Consortium