scrolledlist question

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
scrolledlist question

Submitted by Anonymous on Thu, 09/19/2002 - 01:35. Developers
Hi,

I`m using Motif 1.2 on X11R6. I`ve written an application using scrolledlist in single selection mode, and I`ve added a callback to check for item selection. The problem is no matter an item is selected or unselected, the same callback is called. Is there any way to check whether an item is selected or unselected in the callback?

I also want to have an explicit destroy callback for the scrolledlist, so I use XtAddCallback to register XmNdestroyCallback for the scrolledlist. However, the callback was never called when the application is quitted. Why?

Thanks!

Gary

ICS_support

2) You may have quit the application using the window manager close option, in which case you only get the WM_DELETE_WINDOW message and not the widget destruction. Or, you may have simply called quit(), in which case you don`t get the destruction, either. You need explicitly to destroy the top-level widget.

1) I believe that you get passed a pointer to the structure, something like XmScrollbarCallbackStruct (don`t quote me, I`m without my books here), which should contain a field such as "Boolean on" or "Boolean selected" naming exactly that state.

Anonymous

Try one of the convience routines for XmList that return True if an item is selected or false if not. If you know the position of the item XmListPosSelected (widget, position) and if you don`t know the position of the item you can get it by XmListItemPos(widget, XmString item). It returns the position of the item in the list.