How to make window always stay on top of all other apps wind

I have made an application containing a single window with a few items in. I
want this window to always be on top of all other applications windows
regardless if the PtWindowToFront() method is called by some other
application. I have tried doing

PtSetResource(m_window, Pt_ARG_WINDOW_MANAGED_FLAGS, Ph_WM_FFRONT, 0);

but it does not seem to work. Anyone who knows the trick?

Hello Jens

Make sure that Ph_WM_TOBACK is unset in the Pt_ARG_WINDOW_MANAGED_FLAGS.

Thanks,
Rodney


Jens Burö wrote:

I have made an application containing a single window with a few items in. I
want this window to always be on top of all other applications windows
regardless if the PtWindowToFront() method is called by some other
application. I have tried doing

PtSetResource(m_window, Pt_ARG_WINDOW_MANAGED_FLAGS, Ph_WM_FFRONT, 0);

but it does not seem to work. Anyone who knows the trick?

Hello Rodney, thanks for the tip but I can still not make it work properly.
This is what I do:

int main(int argc, char* argv[])
{
PtWidget_t * window;
PtArg_t args[1];

if (( window = PtAppInit(NULL, &argc, argv, 0, NULL)) == NULL)
exit(1);

// Size
PhDim_t dim = {100, 50};
PtSetResource(window, Pt_ARG_DIM, &dim, 0);

// Location
PhPoint_t pos = {200, 100};
PtSetResource(window, Pt_ARG_POS, &pos, 0);

// Force window to be in front
PtSetResource(window, Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_TRUE,
Ph_WM_FFRONT);
PtSetResource(window, Pt_ARG_WINDOW_NOTIFY_FLAGS, Pt_FALSE,
Ph_WM_TOBACK);
PtSetResource(window, Pt_ARG_WINDOW_MANAGED_FLAGS, Pt_FALSE,
Ph_WM_TOBACK);

PtSetArg(&args[0], Pt_ARG_TEXT_STRING, “Press to exit”, 0);
PtCreateWidget(PtButton, window, 1, args);

PtRealizeWidget(window);

PtMainLoop();

return 0;
}

The window still disappears when another applications window comes up. What
is wrong?

// Jens

“Rodney Dowdall” <rdowdall@qnx.com> wrote in message
news:cftlkl$16d$1@inn.qnx.com

Hello Jens

Make sure that Ph_WM_TOBACK is unset in the Pt_ARG_WINDOW_MANAGED_FLAGS.

Thanks,
Rodney


Jens Burö wrote:
I have made an application containing a single window with a few items
in. I
want this window to always be on top of all other applications windows
regardless if the PtWindowToFront() method is called by some other
application. I have tried doing

PtSetResource(m_window, Pt_ARG_WINDOW_MANAGED_FLAGS, Ph_WM_FFRONT, 0);

but it does not seem to work. Anyone who knows the trick?