Ibrahim Haddad wrote:
> I am trying to refresh a drawing area after modifying its
> drawinf contents. I have this menu item "Refresh", which upon
> clicking on it calls the refreshGraph function.
>
> refresh = XtVaCreateManagedWidget ("Refresh",
> xmCascadeButtonWidgetClass,
> menu_bar,
> XmNmnemonic, 'R',
> NULL);
> XtAddCallback (quit, XmNactivateCallback, refreshGraph, NULL);
Are you actually creating the menu and menu item? Are you adding the
callback for the correct widget? (`quit' seems like an odd name for
a `refresh' option).
> The refreshGraph function is the following:
>
> void refreshGraph( Widget w,
> XtPointer clientData,
> XtPointer callData)
> {
> Window win=XtWindow(w);
> XClearArea(display1, win, 0, 0, 600, 600, TRUE);
> }
BTW, you can use `XClearArea(dpy, win, 0, 0, 0, 0, True)' to clear the
entire window.
> Nothing is actually being refreshed. Could it be because
> I am not using the same "win" used when first creating the
> objects??
The above will clear the widget's window. Have you tried setting a
breakpoint on that function (or adding a printf()) to see if it
actually gets called?
--
Glynn Clements <[EMAIL PROTECTED]>