QNX RTOS v4 Knowledge Base
QNX RTOS v4 Knowledge Base
Title |
Receiving a LOST_FOCUS callbacks from a text widget |
Ref. No. |
QNX.000009858 |
Category(ies) |
Development |
Issue |
We are receiving LOST_FOCUS callback from a text widget and they work just fine, except, we also receive LOST_FOCUS callbacks when the window is destroyed.
We do not want to process the LOST_FOCUS callback on the event that is going to destroy the window. When we receive a callback at the time the container window is being destroyed, the Pt_DESTROYED flag is not SET.
Is there any way to detect that a LOST_FOCUS callback was called because the widget is about to be destroyed?
|
Solution |
Take a look at the widget and all its parents flags to see if one of its parents has been flaged as destroyed. Here is a sample code: x09
x09PtArg_t argt; x09long *flags; x09 x09PtSetArg(&arg, Pt_ARG_FLAGS, &flags, 0); x09for(wp = widget; wp; wp = PtWidgetParent(wp)){ x09x09PtGerResources(wp, 1, &argt); x09x09if(*flags & Pt_DESTROYED) x09x09x09return Pt_CONTINUE; x09} x09. x09. x09.
|
|