When I call ApCreateModule(), the window displays, but it is empty, none of the widgets display (buttons, text boxes, etc…)
The main window is “base”
The second window is “WndLogon”
I want this window to display as soon as the app starts, so I added a callback for the base window opening event (Pt_CB_WINDOW_OPENING). The callback calls:
ApCreateModule(ABM_WndLogon, widget, 0);
I have also tried
ApCreateModule(ABM_WndLogon, widget, cbinfo);
The window displays, but not the button or text box.
I am very new to QNX (1 week) and I have looked through the online help, but to no avail.
I have solved the problem, but I do not understand why nor what the difference is between the current, working version and the previous, non-working version.
Using PhAB…
For the non-working version, I basically followed these steps:
Selected “Project->Add Window…” and built the window with widgets.
Selected “Project->Internal Links…” and made the module link with the previously built window.
Called ApCreateModule() from the callback() function.
Result: Window appeared, but the widges on the window were absent.
For the current, working version I swapped steps 1 and 2, in other words:
Selected “Project->Internal Links…” and made the module link with a non-existent window
I was prompted to create the window at this point.
Called ApCreateModule() from the callback() function.
Result: Window appeared correctly (all widgets present)
I looked over the Resources for both windows, I looked over the *.wgtw files for both windows, but I do not see any difference at all.
Am I missing something. I would really like to know why my first attempt failed.
I think I now have an understanding of the problem.
I was attempting to call ApCreateModule() in the Pt_CB_WINDOW_OPENING callback. It seems like this was a little too early in the process so I moved the ApCreateModule() call to the Pt_CB_REALIZED callback function and everything seems to be working correctly now.