4.5 Busy Frames
When running the Push Me application, you might notice a delay between the time that the
Hello button is pressed and the time that the subframe is displayed. If a delay might confuse
the user about what might be happening, you can provide visual feedback that the application
is at work. You can set the FRAME_BUSY attribute for the frame that issues the request that
might cause the delay. In Example 4-6 we set the XV_SHOW attribute in the base frame. Thus,
show_cmd_frame() might have looked like the following code fragment:
show_cmd_frame(subframe,event)
Frame subframe;
Event *event;
{
xv_set(baseframe, FRAME_BUSY, TRUE, NULL);
xv_set(subframe, XV_SHOW, TRUE, NULL);
xv_set(baseframe, FRAME_BUSY, FALSE, NULL);
}
The effect of this action is that the base frame’s header will be grayed out and the cursor will
change to a timeout cursor. When the subframe has been displayed, the base frame’s appear-
ance is resumed and the cursor restored. If excessively long delays are expected, then this
method might not be adequate—all other buttons and events are suspended until the callback
routine has returned control to the Notifier.
Note that FRAME_BUSY only grays the title bar and sets the busy cursor for the frame passed
to xv_set(). If your application has many subframes and you wish each of them to
become busy, you need to set this attribute for each frame.
4.6 Frame Sizes
The size of any type of frame can be set or queried using either of two convenience functions
available from the FRAME package. ...