QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Attaching a raw callback to a PtList |
Ref. No. |
QNX.000009765 |
Category(ies) |
Development |
Issue |
We are trying to detect a double click. We are using a PtList box to which we are trying to attach a raw callback. We enabled the Pt_EV_BUT_PRESS mask, but still can't get the callback to trigger. What should we check for?
|
Solution |
In 1.14 and earlier Photons, Pt_CB_RAW callbacks won't be invoked for events which are consumed by a widget's class methods. Which is the case for press and releases on a PtList widget. You could use a Pt_CB_FILTER callback instead...this is called before the widget's class even sees the event.
To detect a double click, attach a Pt_CB_SELECTION callback and check the event type. It's Ph_EV_BUT_PRESS: x09PhPointerEvent_t *pev = PhGetData(cbinfo->event); x09and take a look at: x09pev->click_count; The main advantage here over the filter callback is that you are informed which item is being clicked on in the same callback that you find out it is the second click.
|
|