Submitted by orank on Tue, 08/13/2002 - 13:21. Developers
Hi ,
I need to invoke a redraw (repaint) operation/event on a top level menu window and all its attached children widgets.
I am looking for a X / Xm / Xt command that will do something like that.
I want to give the function the widget ID of the top Level widget and I need the function to cause a redraw of all the menu window with all that is in side of the menu.
Is there a function like that ? I searched the web but didn?t find any thing that sounds like what I need.
Thanks in advance and All The Best
Hi,
First, I`m supposing your familiar with [Xt/m]ManageChildren, XmNresizeCallback, et al... These are common widget update scenarios. These are easily invoked handlers.
You really need to say more about the widget. The widgets name is really important (ie, is it an Xm scrolled window?)
Some widgets manage their own drawing areas, others are managed by libraries which do [things] for them. Either way there is likely a callback to trigger through the widget interface that will update. Calling a callback for a widget that doesn`t actually have the code to handle the callback can, of course, core the code.
Do you have the source code for the widget in question?
Hi ,
from the answer I gut I see that my intention was not understood.
I will try to explain more carefully
I Have a motif based dialog that includes push buttons and text fields etc?.
The colors of the dialog background and buttons are set from a private colormap that I manage.
When I change the values of the color cell in the colormap the change does not take effect in the dialog until something causes it to repaint. One why is to unmap it and then map it again but that is ugly because it give a flickering look to the UI.
I want the dialog to be repainted again (after I change the color cell value) BUT without unmaping it and mapping it again. I hope that there is a X / Xt / Xm function that gets a window handler or a toplevel widget and repaints its including its children widgets inside.
Another way I found is to use XtVaSetValues and set again the colormap cell to the specific color property of the widget , But I prefer to find something more generic . . .
Is this possible ?
I hope that this message is clearer then the last one and I am sorry for the trouble . . .
You may find that doing an XClearArea() is what you are looking for.
Hi ,
yes XClearArea Does What I needed.
I am now using
XClearArea(display_,window_,0,0,0,0,TRUE);
and then I use
XFlush(display_);
and the window is redrawn.
I found that redrawing the top Level dialog shell in not enough, I have to go over all the widgets in the dialog and apply the XClearArea Function on all of them. Only then I get the desired effect.
Thank you again dbl,
All The Best
oran
In that case, you map an InputOnly window above your regular window and then unmap it; the entire window gets exposure events. This is better that recursively causing exposures. The technique is used in xrefresh, in mwm`s f.refresh, and other sources. See the comp.windows.x FAQ for details.