Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Dynamic list in XmComboBox

5 views
Skip to first unread message

AK

unread,
Feb 4, 2009, 9:02:57 AM2/4/09
to
I want to use a XmComboBox to select a set of parameter, which are
stored in files.
Since the files are generated by a different application I have to
update the list each time when the arrow is activated. But
unfortunately there is just a selection callback which triggers
closing the list but no callback for opening it.
I searched in the internet but I didn't found anything about my
problem - either the solution is too simple or nobody uses dynamic
lists with XmComboBoxes.

Fred

unread,
Feb 4, 2009, 10:33:46 AM2/4/09
to

You could try this:
1. Create a function "MyRefillList". This is an XtActionProc:
void MyRefillList(Widget w, XEvent *event, String *params, Cardinal
num )
{
/* Here you refill the combobox (passed in as w) */
}

Make sure you include a prototype visible before (3) below.

2. Override the translations of the ComboBox:
<Btn1Down>: MyRefillList() CBArmAndDropDownList()

This will cause yout MyRefillList before the dropdown is posted.

3. Add your action:
static XtActionRec myActions[] = {"MyRefillList", MyRefillList};
XtAppAddActions( appContext, myActions, XtNumber(MyACtions) );

--
Fred Kleinschmidt

0 new messages