Home
Developer Resources
QNX RTOS v4
QNX RTOS v4 Knowledge Base

QNX RTOS v4 Knowledge Base

Foundry27
Foundry27
QNX RTOS v4 project
Resources

QNX RTOS v4 Knowledge Base

Title Problem with Pt[Gen]List
Ref. No. QNX.000009800
Category(ies) Development
Issue Is there a bug in Pt[Gen]List widget, because whenever I hit enter in an empty list which has focus, it leads to an SIGSEGV in a selection callback where you try to access x09x09x09x09x09x09x09((PtListCallback_t *)cbinfo->cbdata)->item;?



Solution This is not a bug, it is just a feature that the docs forgot to mention.

If you hit Enter, cbdata->item points to the current item (the one with the dotted line around it). If there is no current item in the widget, cbinfo->item is NULL.

Depending on the selection mode, the current item may or may not be the one of the selected items in the widget. I guess the docs should not say that cbinfo->item is "the selected item" - there might be none or more than one.
Use cbinfo->sel_item_count and cbinfo->sel_items or cbinfo->sel_array (or the convenience functions) to get to the selected
item(s) more reliably.