Ph_WM_STATE_ISHIDDEN, Please Help!

Hi.

I’m trying to get my application to save/restore the current work space. I
have a problem with correctly restoring the minimized window state.

I’m trying to change the Ph_WM_STATE_ISHIDDEN flag inside my window
pre-realize setup function.

The PtWindow documentation for Pt_ARG_WINDOW_STATE says that you can change
the settings to Pt_ARG_WINDOW_STATE before the window is realized.

I’m setting the Pt_ARG_WINDOW_STATE to Ph_WM_STATE_ISHIDDEN in the window
setup function, before the realize. My window always comes up normal. Why?
What am I doing wrong?

If I change the settings for Pt_ARG_WINDOW_STATE in Phab, then whatever I
pick there, is what I get. It seems that changes from the window setup
function are not used at all. Why?

Please help.

Thanks

Augie

Hello Augie

Can you please post the calls to PtSetArg and PtsetResource here please?

Thanks
Rodney



Previously, Augie Henriques wrote in qdn.public.qnx4.photon:

Hi.

I’m trying to get my application to save/restore the current work space. I
have a problem with correctly restoring the minimized window state.

I’m trying to change the Ph_WM_STATE_ISHIDDEN flag inside my window
pre-realize setup function.

The PtWindow documentation for Pt_ARG_WINDOW_STATE says that you can change
the settings to Pt_ARG_WINDOW_STATE before the window is realized.

I’m setting the Pt_ARG_WINDOW_STATE to Ph_WM_STATE_ISHIDDEN in the window
setup function, before the realize. My window always comes up normal. Why?
What am I doing wrong?

If I change the settings for Pt_ARG_WINDOW_STATE in Phab, then whatever I
pick there, is what I get. It seems that changes from the window setup
function are not used at all. Why?

Please help.

Thanks

Augie
\

<gui@qnx.com> wrote in message news:Voyager.010227102841.565276A@rdowdall…

Hello Augie

Can you please post the calls to PtSetArg and PtsetResource here please?

Thanks
Rodney

Yes sir.

/***************************************************************************
/
/* WindowSetup
/
/
**************************************************************************
/
lword WindowSetup(PtWidget_t *link_instance, ApInfo_t *apinfo,
PtCallbackInfo_t *cbinfo)
{
lword n, flags;
PtArg_t args[20];
PhImage_t *imagePtr;

// invalid
if (!gWindowPtr) {
return Pt_END;
}
printf(“Setup %s\n”, gWindowPtr->name);

// change window title and setup window pointer in user data argument
n = 0;
PtSetArg(&args[n], Pt_ARG_WINDOW_TITLE, gWindowPtr->name, 0); n++;
if (gWindowPtr->minimized) {
printf(“Minimixed %s\n”, gWindowPtr->name);
PtSetArg(&args[n], Pt_ARG_WINDOW_STATE, Ph_WM_STATE_ISHIDDEN, 0); n++;
}
PtSetArg(&args[n], Pt_ARG_USER_DATA, &gWindowPtr, sizeof(gWindowPtr));
n++;
PtSetResources(link_instance, n, &args);




// if closed, don’t realize window
if (gWindowPtr->closed) {
return Pt_HALT;
}

// realize window
return Pt_CONTINUE;
}


Thanks

Augie

Previously, Augie Henriques wrote in qdn.public.qnx4.photon:
Hi.

I’m trying to get my application to save/restore the current work space.
I
have a problem with correctly restoring the minimized window state.

I’m trying to change the Ph_WM_STATE_ISHIDDEN flag inside my window
pre-realize setup function.

The PtWindow documentation for Pt_ARG_WINDOW_STATE says that you can
change
the settings to Pt_ARG_WINDOW_STATE before the window is realized.

I’m setting the Pt_ARG_WINDOW_STATE to Ph_WM_STATE_ISHIDDEN in the
window
setup function, before the realize. My window always comes up normal.
Why?
What am I doing wrong?

If I change the settings for Pt_ARG_WINDOW_STATE in Phab, then whatever
I
pick there, is what I get. It seems that changes from the window setup
function are not used at all. Why?

Please help.

Thanks

Augie

\

PtSetArg(&args[n], Pt_ARG_WINDOW_STATE, Ph_WM_STATE_ISHIDDEN, 0); n++;

You are setting the flag resource wrong. This way you don’t change anything,
because the mask (third parameter) is zero.
Correct is:

PtSetArg(&args[n], Pt_ARG_WINDOW_STATE, Ph_WM_STATE_ISHIDDEN,
Ph_WM_STATE_ISHIDDEN); n++;

Markus




}
PtSetArg(&args[n], Pt_ARG_USER_DATA, &gWindowPtr, sizeof(gWindowPtr));
n++;
PtSetResources(link_instance, n, &args);




// if closed, don’t realize window
if (gWindowPtr->closed) {
return Pt_HALT;
}

// realize window
return Pt_CONTINUE;
}


Thanks

Augie




Previously, Augie Henriques wrote in qdn.public.qnx4.photon:
Hi.

I’m trying to get my application to save/restore the current work
space.
I
have a problem with correctly restoring the minimized window state.

I’m trying to change the Ph_WM_STATE_ISHIDDEN flag inside my window
pre-realize setup function.

The PtWindow documentation for Pt_ARG_WINDOW_STATE says that you can
change
the settings to Pt_ARG_WINDOW_STATE before the window is realized.

I’m setting the Pt_ARG_WINDOW_STATE to Ph_WM_STATE_ISHIDDEN in the
window
setup function, before the realize. My window always comes up normal.
Why?
What am I doing wrong?

If I change the settings for Pt_ARG_WINDOW_STATE in Phab, then
whatever
I
pick there, is what I get. It seems that changes from the window
setup
function are not used at all. Why?

Please help.

Thanks

Augie



\

“Markus Loffler” <loffler@ces.clemson.edu> wrote in message
news:97g2cc$aup$1@inn.qnx.com

PtSetArg(&args[n], Pt_ARG_WINDOW_STATE, Ph_WM_STATE_ISHIDDEN, 0); n++;

You are setting the flag resource wrong. This way you don’t change
anything,
because the mask (third parameter) is zero.
Correct is:

PtSetArg(&args[n], Pt_ARG_WINDOW_STATE, Ph_WM_STATE_ISHIDDEN,
Ph_WM_STATE_ISHIDDEN); n++;

Thanks. I knew it had to be something stupid I did!

Augie

Markus




}
PtSetArg(&args[n], Pt_ARG_USER_DATA, &gWindowPtr, sizeof(gWindowPtr));
n++;
PtSetResources(link_instance, n, &args);




// if closed, don’t realize window
if (gWindowPtr->closed) {
return Pt_HALT;
}

// realize window
return Pt_CONTINUE;
}


Thanks

Augie




Previously, Augie Henriques wrote in qdn.public.qnx4.photon:
Hi.

I’m trying to get my application to save/restore the current work
space.
I
have a problem with correctly restoring the minimized window state.

I’m trying to change the Ph_WM_STATE_ISHIDDEN flag inside my window
pre-realize setup function.

The PtWindow documentation for Pt_ARG_WINDOW_STATE says that you can
change
the settings to Pt_ARG_WINDOW_STATE before the window is realized.

I’m setting the Pt_ARG_WINDOW_STATE to Ph_WM_STATE_ISHIDDEN in the
window
setup function, before the realize. My window always comes up
normal.
Why?
What am I doing wrong?

If I change the settings for Pt_ARG_WINDOW_STATE in Phab, then
whatever
I
pick there, is what I get. It seems that changes from the window
setup
function are not used at all. Why?

Please help.

Thanks

Augie





\