Motif/Xt: Trigger reconfiguration of a widget

Marc Balmer marc at msys.ch
Thu Oct 28 07:09:11 UTC 2021


> I am working on Motif code, so please excuse if this mailing list is
> not the right place for asking my question, but since Motif is based on
> libXt, I thought I'll give it a try. --
> 
> I would like to add and remove CascadeButtons dynamically to and from
> a menubar (a.k.a RowColumn widget).
> 
> For each addition of a button I create a completely new menubar
> containing the button(s) to be added and set it in the MainWindow via:
> 
>    XtVaSetValues(main_window, XmNmenuBar, new_menubar, NULL);
> 
> The good news is that the program does not crash :) but the menubar is
> not updated either. Only when I resize the application window does the
> menubar get updated and displays the new button(s).
> 
> So my question is: How can I trigger the reconfiguration of a widget's
> geometry without having to resize the main window?

The XmUpdateDisplay() function does exactly this.  Call it with the top level widget as parameter.


More information about the xorg mailing list