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 Focus on the base window in Photon 1.14
Ref. No. QNX.000009879
Category(ies) Development
Issue We have an application with only a base window and hotkey callbacks (e.g. when '1' is pressed, window is filled with color). Our system has a mouse, but we do not need it in our application. After starting application and pressing '1', the window does not get painted, but the icon on the bottom of the desktop does.
When starting our application, we have to mouse click on the base window, otherwise the application would not respond.
Pt_AUTOHIGHLIGHT is set , the pointer still has to be moved over the window.
What could be the problem?



Solution The 'cursor focus' workspace option is on. This means that the keys will only go to the window the mouse is over. If this option is off, the window will get a focus as soon as it is created, and your callback will work.
You are drawing outside of any widget or widget context, and the widget library sets which region it wishes to draw from automatically, and the last thing to draw before you was your icon.
So the icon's region is the current draw source.

Call
x09PgSetRegion(PtWidgetRid(your_window_widget));
and then draw.

For more info see the docs in programmer's reference: raw drawing and animation, and see also PtRaw widget.