Selection/Layout

Whenever I try to set a resource, I get the error message: "Widget Does Not Allow Resource to be Modified at this Time". What does this mean and how do I work around this?

First, let’s explain why this error message is generated.

When you request BX to set a resource, it sets the resource using the standard XtSetArg routine. It then reads the value of he resource back using the standard XtGetArg function. If the values read back do not match the new values, BX generates the error message "Widget Does Not Allow Resource to be Modified at this Time". Basically, this error message means that the Motif toolkit you are using is not allowing the resource to be set.

When I build my GUI everything looks great in BX in both Build mode and Play mode. Yet, when I build and run the actual application, things look different. For example, I have different fonts, widget sizes differ, etc. What is going on?

Although there are several potential causes for this behavior (for example, see other FAQ questions on app-defaults), if you are using Linux, the most common one is that you are using two different versions of Motif. BX uses the Motif shared libraries found on your system. However, it is also possible you also have LessTif (a LGPL clone of Motif) installed, or some older version of Motif. If you are not careful with your link line you might find that your application is using something other than what you expected.

I keep getting an error message that I’m trying to attach a widget to the wrong parent? How do I know what are the legal combinations?

One of the toughest challenges facing a new Motif developer is determining which widgets can be children of which parents. ICS recommends that new Motif developers select "Keep Parent" (Main Window->View). The Keep Parent option only allows valid children of the currently selected widget to be selected on the palette. In Keep Parent mode, you first select which object is going to be the parent by clicking on it in your user interface or in the Browser. Widgets on the palette that remain sensitive are valid children of the currently selected widget.

I keep missing the drop site as I try to parent a new widget. Is there an alternative mechanism?

Sometimes it is difficult to zero in on the exact drop site when adding a widget to your user interface. For example, when adding a pushButton to a cascadeButton, it is easy to miss the drop site and end up with the pushbutton parented to the wrong widget. In cases like these, it is usually much easier to select the widget on the palette with MB2 and then drop it on the desired parent widget in the Browser. If you prefer the WYSIWYG approach, then the next question on Keep Parent might be a solution.

How do I select a parent widget and all its children?

You can select or unselect an entire hierarchy of widgets by holding the Shift key and selecting the top widget in the hierarchy in the Browser. You can also select an entire hierarchy of widgets in your user interface by using the lasso-selection. Select the container and its children by holding the Shift key while dragging a box around the manager using MB1. Then move the selected group using MB1.

Subscribe to Selection/Layout