[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: Motif/Xt: Trigger reconfiguration of a widget
From:       "Chris Sorenson" <csoren () cpinternet ! com>
Date:       2021-10-29 2:48:25
Message-ID: 1635475705.glty2c9ysckkkgg0 () webmail ! mycci ! net
[Download RAW message or body]

> 
> Thanks for the hint! Calling XmUpdateDisplay() did not have the desired
> effect, however.
>  
> It turned out that I have to explicitly do an XtDestroyWidget() on the
> old menubar before setting the new one (which I had not yet done). It
> seems like -- if you don't do this -- the MainWindow widget keeps a
> reference of the old menubar somehow still around, even though it should
> have been overwritten by XtVaSetValues(XmNmenuBar).
>  
> Best,
> Holger
>

If you just want to redraw one widget, you can do it like this ("w" is the  
widget), you have to include a private header though, for access to
core_class.expose

#include <X11/IntrinsicP.h>

XExposeEvent xev;
Dimension ww, hh; /* the widget's width and height */

xev.window   = XtWindow(w);  
xev.type      = Expose;
xev.display = XtDisplay(w);

XtVaGetValues(w, XmNwidth, &ww, XmNheight, &hh, NULL);

xev.width   = ww;
xev.height = hh;

(XtClass (w))->core_class.expose(w, (XEvent *) &xev, NULL);
  
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic