Troubleshooting in WorkShop Visual |
23 |
![]() |
Cause and Solution: These labels are only available when the correct resource file is read. If the labels are not available, X substitutes variable names. Reconfigure your system so WorkShop Visual reads the WorkShop Visual resource file. There are several ways to do this in X. Consult your system administrator.
Cause and Solution: Your configuration may be reading an obsolete version of the WorkShop Visual resource file. Check the software version and make sure WorkShop Visual is reading the resource file that came with that version.
Cause and Solution: Either your X environment is not finding the correct resource file, or the resource file is not accessing the correct search path. Make sure the "helpDir" resource contains the search path for your WorkShop Visual help database.
For advice on setting resources for specific widgets and combinations of widgets, lookup the widget in Chapter 22, "Widget Reference" and your Motif documentation. Note that many apparent problems with resource settings can be solved by resetting the widget involved or the Shell.
When you set values in WorkShop Visual's resource panels, WorkShop Visual actually resets resources of widget instances in the dynamic display. Sometimes the results are not what you expect:
Resource Settings Are Rejected
Symptoms:
For example, if a RadioBox contains a group of ToggleButtons, the width of the individual ToggleButtons is determined by their text and margin resources; the width of the RadioBox is calculated from the width of its widest child; and all the ToggleButtons are forced to be the same width as the widest one. A width setting on the Core resource panel is overridden by the calculated value. If the RadioBox is in turn the child of a Form, attachments set in the Layout Editor can override the RadioBox rules.
Solution: Check your design for constraints that may be overriding the setting. Use the constraints imposed by other widgets to achieve the desired effect.
Solutions: Reset the widget. If that doesn't work, reset the Shell. If resetting the Shell doesn't work, consult the Widget Reference chapter. You may need to set two or more resources to achieve a single effect. For example, to display a pixmap on a label or button, you must set the "Pixmap" resource to specify the pixmap you want, and set the "Type" resource to "Pixmap."
A few resources are never reflected in the dynamic display, as discussed below.
Cause and Solution: The width and height Core resources of any widget can be overridden, either by resources specific to that widget class or by geometry rules of the widget's parent. Consult Chapter 22, "Widget Reference", starting on page 653, or Motif documentation for information about resources of the widget and its parent that may be controlling its size.
Cause and Solution: The width and height Core resources of a Shell can be overridden by the corresponding resources of the Shell's child. One way to control the size of a dialog is to set the width and height resources of the Shell's child. Another way is to set the minimum width and height resources of the Shell, which are not overridden by the child.
Resources Are Not Reflected After Resetting
Symptom: The resource panel accepts your resource settings, but they are not reflected in the dynamic display even when you reset the widget.
Cause: When a widget does not have an explicit font setting, Motif searches back through the design hierarchy to find the widget's nearest BulletinBoard, BulletinBoard derivative, or Shell ancestor, and uses the font setting of that ancestor for the current widget. Therefore, if several buttons all have default font settings but are children of different BulletinBoards, some may show different fonts from others.
Solution: Setting a font on the BulletinBoard or Shell instead of on individual widgets is a convenient way of setting all the fonts at once. To get uniformity you must use the same font on all parent widgets with explicit font settings. A font object is a convenient way to do this.
Cause and Solution: The new font setting on a parent widget does not affect the children until you reset the parent widget. Reset the parent widget.
Cause and Solution: Font settings on parent widgets do not affect their children if the children have explicit font settings of their own. Make sure the children have default font settings.
Cause: This is a bug in some versions of Motif. The DialogTemplate resizes properly to accommodate the button box and work area, but if the MenuBar exceeds the width of the button box and work area, it is cut off.
Solution: Add the button box and work area children to the DialogTemplate before you add the CascadeButtons to the MenuBar. In many cases the width of your work area or button box will create enough width to accommodate the MenuBar.
Solution: If your MenuBar is still too wide to display, use a Form as the work area, or put the work area inside a Form, then use the Layout Editor to add extra space around the work area.
Solution: You can force the DialogTemplate to be wider by setting its "Width" resource on the Core resource panel.
Cause and Solution: In some versions of Motif there is a bug in the Form that appears when the Form is a child of a DialogTemplate. When you reset the Form, any container widgets inside the Form become very small. If you have this problem, resetting the DialogTemplate instead of the Form corrects it. To do this, you must go from the Layout Editor screen to the main WorkShop Visual screen, select the DialogTemplate in the construction area, and give the "Reset" command. To resume working in the Layout Editor, first select the Form again in the construction area.
Cause and Solution: Attachments can change the size of a widget. For example, attaching the edges of a widget to the corresponding edges of the Form forces the widget to span the full width or height of the Form. Reset the Form. If resetting the Form doesn't work, remove some of the attachments from the widget and reset again.
Methods of breaking attachments are listed below. For a more complete discussion, see Chapter 4, "The Layout Editor", starting on page 103.
Cause and Solutions: If you add an attachment that results in a circularity involving two or more widgets, Motif detects the circularity and returns the error message. Click on "Undo." If you still get the error message, carefully inspect your layout for an attachment loop and remove one of the attachments.
Cause and Solutions: This Motif message indicates that your layout contains attachments that contradict one another without being circular. It usually occurs with "Self" or "Position" attachments. Use "Undo" or move the widgets to remove the contradictory attachments, then reset the Form.
Causes: Widgets whose edges coincide with the sides of the Form can overlap the line drawn around the Form, causing undesirable breaks in the line. This only occurs if the Form is the immediate child of a Shell. Three conditions in the Form can cause the overlap:
Solution: Put the Form inside another manager widget, such as another Form or a DialogTemplate. This is the simplest and most flexible solution.
Cause and Solution: The Link facility requires the target widget to have an explicit variable name. If the target widget is a Shell, its immediate child must also have an explicit name. WorkShop Visual grays out the "Add" option if it does not find explicit names. Name the appropriate widgets.
Cause and Solution: If you change the name of a widget, WorkShop Visual does not automatically update links that refer to that widget and they cease to be functional. Remove the obsolete links and replace them with new ones.
Cause: WorkShop Visual interprets the selection of any new widget as a target widget for a potential new link on the previously selected button.
Solution: Pull down the Widget Menu and select "Edit links" again to display and edit links on the second button. You do not have to close the Links panel first.
"No Application Shell" Warning
Symptom: WorkShop Visual displays a "No Application Shell" warning message when you try to generate the primary module with a main() program. Links are Undefined
Symptom: Link functions are undefined at link time. Global Widgets Are Undefined
Symptom: Global widgets are undefined when you compile the stubs file. Application Does Not Use Resources from X Resource File
Symptom: The generated application doesn't use the resource values from the generated X resource file. For example, variable names appear on labels and buttons instead of the label strings, colors are wrong, or fonts are wrong. The exact symptoms depend on which resources were generated into the X resource file and which were hard-wired. Default Resources Change At Run Time
Symptom: A color, font, or other resource is different at run time from that in the dynamic display. Unexpected Results Occur When Widgets Share a Widget Name
Resource values can be shared among widgets with a common widget name, but only if they are read from the X resource file into the resource data base. The following rules apply:
Cause: These are expected results when widgets share a widget name. The dynamic display and hard-wired resource settings disregard common widget names. Resources generated into the X resource file, however, affect all widgets with a common widget name.
Symptom: A color or font is not shared among widgets with a common widget name, even if that resource was generated to the X resource file.
Cause and Solution: The color or font used an object binding instead of a color or font setting. Use a simple color or font setting, or set the resource on a common parent of the widgets that you want to share the value.
Symptom: An explicitly set resource value is overridden at run time.
Cause: If widgets share a widget name and resources are generated to the X resource file, only one value is used even if more than one was set.
Solution: Generally it is better to avoid common widget names unless widgets are to share all resource values. However, you can force any resource value to be restricted to a single widget by hard-wiring it. Use the masking toggles on the resource panels to do this.