widget = XtCreateManagedWidget(name, multiListWidgetClass, ...);
MultiList is a replacement for the Athena List widget, which allows multiple selections to be made. The aesthetics have also been slightly improved: the highlight colors can now be selected, and the selection extends across the entire width of the column rather than just the length of the string.
The maximum number of multiple selections can be specified. Items are selected and unselected by an action interface. By default, mouse button 1 is used to select, unselect, and toggle items. When the mouse button is lifted, any callbacks in the callback list are called with a data structure which describes the count of select items, and lists the indices of the selected items. The return structure contains some additional information describing the last item modified and the last action performed, which will probably not be of general use, and I'd love to delete if I was sure that people didn't use them. (The behavior of these fields has changed slightly in V3.4).
Name | Class | Type | Default |
XtNbackground | Background | Pixel | XtDefaultBackground |
XtNborder | BorderColor | Pixel | XtDefaultForeground |
XtNborderWidth | BorderWidth | Dimension | 1 |
XtNcallback | Callback | XtCallbackList | NULL |
XtNcolumnWidth | Width | Dimension | 0 |
XtNcolumnSpacing | Spacing | Dimension | 8 |
XtNcursor | Cursor | Cursor | left_ptr |
XtNdefaultColumns | Columns | int | 1 |
XtNdestroyCallback | Callback | Pointer | NULL |
XtNfont | Font | XFontStruct | XtDefaultFont |
XtNforceColumns | Columns | Boolean | False |
XtNforeground | Foreground | Pixel | XtDefaultForeground |
XtNheight | Height | Dimension | 0 |
XtNhighlightBackground | HBackground | Pixel | XtDefaultForeground |
XtNhighlightForeground | HForeground | Pixel | XtDefaultBackground |
XtNinsensitiveBorder | Insensitive | Pixmap | Gray |
XtNlist | List | String | NULL |
XtNlongest | Longest | int | 0 |
XtNmappedWhenManaged | MappedWhenManaged | Boolean | True |
XtNmaxSelectable | Value | int | 1 |
XtNnumberStrings | NumberStrings | int | 0 |
XtNpasteBuffer | Boolean | Boolean | False |
XtNrowHeight | Height | Dimension | 0 |
XtNrowSpacing | Spacing | Dimension | 2 |
XtNsensitive | Sensitive | Boolean | True |
XtNsensitiveArray | List | Boolean | NULL |
XtNverticalList | Boolean | Boolean | False |
XtNwidth | Width | Dimension | 0 |
XtNx | Position | Position | 0 |
XtNy | Position | Position | 0 |
void XfwfMultiListHighlightItem(mlw,item_index) XfwfMultiListWidget mlw; int item_index;
void XfwfMultiListHighlightAll(mlw) XfwfMultiListWidget mlw;
void XfwfMultiListUnhighlightItem(mlw,item_index) XfwfMultiListWidget mlw; int item_index;
void XfwfMultiListUnhighlightAll(mlw) XfwfMultiListWidget mlw;
int XfwfMultiListToggleItem(mlw,item_index) XfwfMultiListWidget mlw;
XfwfMultiListReturnStruct *MultiListGetHighlighted(mlw) XfwfMultiListWidget mlw;
Boolean XfwfMultiListIsHighlighted(plw,item_index) XfwfMultiListWidget mlw; int item_index;
Boolean XfwfMultiListGetItemInfo(mlw,item_index,str_ptr,h_ptr,s_ptr) XfwfMultiListWidget mlw; int item_index; String *str_ptr; Boolean *h_ptr,*s_ptr;
void XfwfMultiListSetNewData(mlw,list,nitems,longest,resize,sensitivity_array) MultiListWidget mlw; String *list; int nitems,longest; Boolean resize; Boolean *sensitivity_array;
There are likely to be inadequacies in this code. Specifically, I am not sure what the callback interface should look like when you can select and unselect multiple items. This is the reason for the confusing return structure fields. Please send bug reports and feature requests to the email address below.
Brian Totty, totty@cs.uiuc.edu Department of Computer Science, University of Illinois at Urbana-Champaign 1304 W. Springfield Avenue Urbana, IL 61801