Hello,
I am trying to use the PtMessage widget in the setup function of the
base window of a Phab application. I cannot get the PtMessage window
to realize. I am trying to execute a subroutine very similar to the
“askresponse()” example given in the PtModalStart() function
description.
The subroutine does the following:
void sub()
{
PtSetArg() /* to set message resources /
PtSetArg() / to set callbacks for buttons in widget */
PtRealizeWidget(PtCreateWidget(PtMessage, NULL, n, args));
count = PtModalStart();
while(!answer) /* wait for button press */
PtProcessEvent();
PtModalEnd(count);
return;
}
The problem I have is that the PtMessage pop-up never pops up. The
program then just hangs, because there is no pop-up message with a
button to select.
The PtCreateWidget routine returns a widget pointer, the
PtRealizeWidget returns -1, ‘count’ appears to be zero after the
PtModalStart call.
This problem only occurs when I call this routine from the setup
function of the base window in a Phab application. When it is called
from setup functions of dialog boxes, it works fine. Also, the two
subroutines PtMessageBox and PtAskQuestion both pop up without
problems when run from the same base window setup routine.
BTW, I am using this method to display error messages instead of using
PtAskQuestion because I can control the placement of the PtMessage
pop-up. I am using a dual monitor system and the PtAskQuestion pop-up
pops up centered in the split between the two monitors.
Any ideas why the PtMessage box won’t pop up, or how I can control the
placement of the PtAskQuestion pop-up.
I am using QNX 4.25, Photon v1.14.
Thanks for your help,
Greg Laird