linuxsolarisx11motif

What is the right way of building a long scroll list of button widgets in Motif?


I'm dealing with an old Motif application that needs to load and display a long list of entries (around 1500). It creates and manages an instance of xmFormWidgetClass via XtVaCreateManagedWidget() and then it stuffs it with a bunch of linear hierarchies xmFrameWidgetClass->xmFormWidgetClass->xmFormWidgetClass->xmPushButtonWidgetClass. Each PushButton contains a multi-line label. When this this thing is being populated, it takes a lot of CPU, which it spends doing some geometry calculations inside of X/Motif libraries. The pace at which new buttons are added, degrades very quickly. It looks like there is an O(N) algorithm being used inside of XtVaCreateManagedWidget().

The things get much much better if I do XtUnrealizeWidget() on the original instance of the xmFormWidgetClass. Entries are being added at almost constant speed but then I cannot find a way to display the whole thing that I built. XtRealizeWidget() for the original instance of the xmFormWidgetClass does not render it in the window.

What am I doing wrong? Is there a way to populate the hierarchy and then calculate the geometry and render it to the screen at once?

Redesigning the application is an option but it is a last resort type on an option.

Any advice that keeps me within Motif libraries will be highly appreciated!

Regards, /Sergey


Solution

  • Try calling XtManageChild after XtRealizeWidget.