XtSetSensitive problem

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
XtSetSensitive problem

Submitted by Anonymous on Mon, 08/05/2002 - 21:32. Developers
I have a few buttons and Xbae Matrix widgets as a part of a form. I need to disable the form when something is selected for editing in the list. Edit is one of the buttons. So in the Edit callback funtions, I do the following call

XtSetSensitive(form_name, False);

The form does get disabled and neither the buttons nor the Xbae Matrix widget is active. But the problem is appearence. The appearence of the widget does not come as disable (grey text). The Xbae Matrix widget becomes complete blank.

I have a couple of pop-up messages in the application. When the messages are poped, I maked the same call to make the form insensitive. This time the appearence is PERFECT, all buttons with grey text and Xbae Matrix widget is also greyed out.

Please help if there is any specific resource for the form or the wigets which need to be set properly.

ICS_support

Redisplay problems are usually caused by not letting Xt return to the event loop to dispatch expose events. When you change the sensitivity, there is essentially a need-for-redisplay in a virtual queue of actions -- in real terms, an Expose event queued up which needs to be responded to. You`ll hit this problem if you do this

some_action();
XtSetSensitive();
some_other_action();

and expect the new visuals to appear during the some_other_action() call.

There are several ways around this, including putting some_other_action() in a 1ms timeout. You can also force handling of expose events by using XmUpdateDisplay().