Section: User Commands (1)
Updated: editres 1.0.6
Editres is a tool that allows users and application developers to view the full widget hierarchy of any X Toolkit application that speaks the Editres protocol. In addition, editres 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 editres will append the resource string to the user's X Resources file.
Editres provides a window consisting of the following four areas:
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.
The Tree menu contains several commands that allow operations to be performed on the widget tree.
:Show Widget Names
:Show Class Names
:Show Widget IDs
In addition there are keyboard accelerators for each of the Tree operations. If the input focus is over an individual widget in the tree, then that operation will only effect that widget. If the input focus is in the Tree background it will have exactly the same effect as the corresponding menu item.
The translation entries shown may be applied to any widget in the application. If that widget is a child of the Tree widget, then it will only affect that widget, otherwise it will have the same effect as the commands in the tree menu.
<TABLE> <TR VALIGN="top| <TD CLASS="c1|Key</TD> <TD CLASS="c1|Option</TD> <TD>Translation Entry
</TD> </TR> <TR VALIGN="top| <TD>-</TD> <TD></TD> <TD>
</TD> </TR> <TR VALIGN="top| <TD>space</TD> <TD>Unselect</TD> <TD>Select(nothing)
</TD> </TR> <TR VALIGN="top| <TD>w</TD> <TD>Select</TD> <TD>Select(widget)
</TD> </TR> <TR VALIGN="top| <TD>s</TD> <TD>Select</TD> <TD>Select(all)
</TD> </TR> <TR VALIGN="top| <TD>i</TD> <TD>Invert</TD> <TD>Select(invert)
</TD> </TR> <TR VALIGN="top| <TD>c</TD> <TD>Select Children</TD> <TD>Select(children)
</TD> </TR> <TR VALIGN="top| <TD>d</TD> <TD>Select Descendants</TD> <TD>Select(descendants)
</TD> </TR> <TR VALIGN="top| <TD>p</TD> <TD>Select Parent</TD> <TD>Select(parent)
</TD> </TR> <TR VALIGN="top| <TD>a</TD> <TD>Select Ancestors</TD> <TD>Select(ancestors)
</TD> </TR> <TR VALIGN="top| <TD>N</TD> <TD>Show Widget Names</TD> <TD>Relabel(name)
</TD> </TR> <TR VALIGN="top| <TD>C</TD> <TD>Show Class Names</TD> <TD>Relabel(class)
</TD> </TR> <TR VALIGN="top| <TD>I</TD> <TD>Show Widget IDs</TD> <TD>Relabel(id)
</TD> </TR> <TR VALIGN="top| <TD>W</TD> <TD>Show Widget Windows</TD> <TD>Relabel(window)
</TD> </TR> <TR VALIGN="top| <TD>T</TD> <TD>Toggle Widget/Class Name</TD> <TD>Relabel(toggle)
</TD> </TR> </TABLE>
Clicking button 1 on a widget adds it to the set of selected widgets. Clicking button 2 on a widget deselects all other widgets and then selects just that widget. Clicking button 3 on a widget toggles its label between the widget's instance name the widget's class name.
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 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.
\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.
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.
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.
The accepted values are:
Remember that these resources are set on any Xaw application, not editres. They allow individual applications to keep all or some of the requests editres makes from ever succeeding. Of course, editres is also an Xaw application, so it may also be viewed and modified by editres (rather recursive, I know), these commands can be blocked by setting the editresBlock resource on editres itself.
For editres the available application resources are:
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
Chris D. Peterson, formerly MIT X Consortium
Tutoriais de Tecnologia Web