Bringing base window to front

This seems like there should be a simple solution, but I keep running into
problems.
I have a base window where I am doing all my work. I have the option to
open a dialog box that holds an RtTrend on it. I want to be able to move it
to the side and if need be, have the base window on top covering over the
dialog box with RtTrend on it.
I have tried every combination of flag settings I can think of, as well as
using the event.event commands and nothing seems to work.
I was able to manage a temporary solution moving the RtTrend to a Window
from the dialog. And calling the event. But this ran into further problems
as I tried to operate the controls on the base window, the trend window kept
wanting to jump to the front.

Surely there is an easy way to control this, that I am just missing. If
anyone can help me, I sure would appreciate it. I am using Photon 1.13.

Ben Burns

Hello Ben

The problem is that the Dialog is a child of the window, and childeren
can never be placed behind their parent. What you need to do is, after
you have created the dialog, reparent it to nothing. Now you should be
able to have the dialog go behind the base window. Just as a side note,
if it was a window instead of a dialog, then you could use the call ApModuleParent
before your call ApCreateModule ( if this is how you are creating your dialogs ) and
then you wouldn’t have to reparent the widget afterwards, but in Photon 1.1x, the
ApModuleParent function only works with windows, and not dialogs.

Thanks
Rodney

Ben Burns <bburns@nyab.com> wrote:

This seems like there should be a simple solution, but I keep running into
problems.
I have a base window where I am doing all my work. I have the option to
open a dialog box that holds an RtTrend on it. I want to be able to move it
to the side and if need be, have the base window on top covering over the
dialog box with RtTrend on it.
I have tried every combination of flag settings I can think of, as well as
using the event.event commands and nothing seems to work.
I was able to manage a temporary solution moving the RtTrend to a Window
from the dialog. And calling the event. But this ran into further problems
as I tried to operate the controls on the base window, the trend window kept
wanting to jump to the front.

Surely there is an easy way to control this, that I am just missing. If
anyone can help me, I sure would appreciate it. I am using Photon 1.13.

Ben Burns

Rodney,
Thanks for the reply. I had pretty much figured out what you said. But
am still running into a problem. Here is what is happening.
I have a menu bar on my main base window. When I press it, and then press
one of the menu buttons I do a dialog callback to create the dialog widget
that has on it the RtTrend.
I then do a PtSetParentWidget(NULL) in the callback code.

At this point I still cannot move the dialog to the back by just pressing
the windows.
So I put in a callback from lost focus to call a piece of code that does:
PtWindowToBack(widget)

And we have it the widget moves to the back. And if I click on it, it moves
back to the front. Problem I am having is, now any thing I do on the main
base widow that involves calling another dialog box, gets screwy. They all
show up behind the main window now. This makes it very difficult to do
anything.
Anyhelp you can give me would be appreciated. Is there any flags I should
set, etc…

Thanks again,

Ben

“Gui Group” <gui@qnx.com> wrote in message news:9q1rpl$q7p$1@nntp.qnx.com

Hello Ben

The problem is that the Dialog is a child of the window, and childeren
can never be placed behind their parent. What you need to do is, after
you have created the dialog, reparent it to nothing. Now you should be
able to have the dialog go behind the base window. Just as a side note,
if it was a window instead of a dialog, then you could use the call
ApModuleParent
before your call ApCreateModule ( if this is how you are creating your
dialogs ) and
then you wouldn’t have to reparent the widget afterwards, but in Photon
1.1x, the
ApModuleParent function only works with windows, and not dialogs.

Thanks
Rodney

Ben Burns <> bburns@nyab.com> > wrote:
This seems like there should be a simple solution, but I keep running
into
problems.
I have a base window where I am doing all my work. I have the option to
open a dialog box that holds an RtTrend on it. I want to be able to
move it
to the side and if need be, have the base window on top covering over
the
dialog box with RtTrend on it.
I have tried every combination of flag settings I can think of, as well
as
using the event.event commands and nothing seems to work.
I was able to manage a temporary solution moving the RtTrend to a Window
from the dialog. And calling the event. But this ran into further
problems
as I tried to operate the controls on the base window, the trend window
kept
wanting to jump to the front.

Surely there is an easy way to control this, that I am just missing. If
anyone can help me, I sure would appreciate it. I am using Photon 1.13.

Ben Burns

Well, I never did get the dialog boxes working like I wanted. I don’t think
I was reparenting them right.
But I did manage to get everything working with the windows. The key is to
set the parent before you create the window. And then not to forget to kill
those orphaned windows when you close the main.
Thanks for your help,
Ben

“Ben Burns” <bburns@nyab.com> wrote in message
news:9q2809$quq$1@inn.qnx.com

Rodney,
Thanks for the reply. I had pretty much figured out what you said.
But
am still running into a problem. Here is what is happening.
I have a menu bar on my main base window. When I press it, and then press
one of the menu buttons I do a dialog callback to create the dialog widget
that has on it the RtTrend.
I then do a PtSetParentWidget(NULL) in the callback code.

At this point I still cannot move the dialog to the back by just pressing
the windows.
So I put in a callback from lost focus to call a piece of code that does:
PtWindowToBack(widget)

And we have it the widget moves to the back. And if I click on it, it
moves
back to the front. Problem I am having is, now any thing I do on the main
base widow that involves calling another dialog box, gets screwy. They
all
show up behind the main window now. This makes it very difficult to do
anything.
Anyhelp you can give me would be appreciated. Is there any flags I should
set, etc…

Thanks again,

Ben

“Gui Group” <> gui@qnx.com> > wrote in message
news:9q1rpl$q7p$> 1@nntp.qnx.com> …
Hello Ben

The problem is that the Dialog is a child of the window, and childeren
can never be placed behind their parent. What you need to do is, after
you have created the dialog, reparent it to nothing. Now you should be
able to have the dialog go behind the base window. Just as a side note,
if it was a window instead of a dialog, then you could use the call
ApModuleParent
before your call ApCreateModule ( if this is how you are creating your
dialogs ) and
then you wouldn’t have to reparent the widget afterwards, but in Photon
1.1x, the
ApModuleParent function only works with windows, and not dialogs.

Thanks
Rodney

Ben Burns <> bburns@nyab.com> > wrote:
This seems like there should be a simple solution, but I keep running
into
problems.
I have a base window where I am doing all my work. I have the option
to
open a dialog box that holds an RtTrend on it. I want to be able to
move it
to the side and if need be, have the base window on top covering over
the
dialog box with RtTrend on it.
I have tried every combination of flag settings I can think of, as
well
as
using the event.event commands and nothing seems to work.
I was able to manage a temporary solution moving the RtTrend to a
Window
from the dialog. And calling the event. But this ran into further
problems
as I tried to operate the controls on the base window, the trend
window
kept
wanting to jump to the front.

Surely there is an easy way to control this, that I am just missing.
If
anyone can help me, I sure would appreciate it. I am using Photon
1.13.

Ben Burns
\

Hello Ben

I don’t have a reason as to why it didn’t work with the dialogs, but I’m glad that
you found a solution. If you wanted to send me a sample of what you were trying
to do with the dialogs, I may be able to come up with something.

Thanks
Rodney

Ben Burns <bburns@nyab.com> wrote:

Well, I never did get the dialog boxes working like I wanted. I don’t think
I was reparenting them right.
But I did manage to get everything working with the windows. The key is to
set the parent before you create the window. And then not to forget to kill
those orphaned windows when you close the main.
Thanks for your help,
Ben

“Ben Burns” <> bburns@nyab.com> > wrote in message
news:9q2809$quq$> 1@inn.qnx.com> …
Rodney,
Thanks for the reply. I had pretty much figured out what you said.
But
am still running into a problem. Here is what is happening.
I have a menu bar on my main base window. When I press it, and then press
one of the menu buttons I do a dialog callback to create the dialog widget
that has on it the RtTrend.
I then do a PtSetParentWidget(NULL) in the callback code.

At this point I still cannot move the dialog to the back by just pressing
the windows.
So I put in a callback from lost focus to call a piece of code that does:
PtWindowToBack(widget)

And we have it the widget moves to the back. And if I click on it, it
moves
back to the front. Problem I am having is, now any thing I do on the main
base widow that involves calling another dialog box, gets screwy. They
all
show up behind the main window now. This makes it very difficult to do
anything.
Anyhelp you can give me would be appreciated. Is there any flags I should
set, etc…

Thanks again,

Ben

“Gui Group” <> gui@qnx.com> > wrote in message
news:9q1rpl$q7p$> 1@nntp.qnx.com> …
Hello Ben

The problem is that the Dialog is a child of the window, and childeren
can never be placed behind their parent. What you need to do is, after
you have created the dialog, reparent it to nothing. Now you should be
able to have the dialog go behind the base window. Just as a side note,
if it was a window instead of a dialog, then you could use the call
ApModuleParent
before your call ApCreateModule ( if this is how you are creating your
dialogs ) and
then you wouldn’t have to reparent the widget afterwards, but in Photon
1.1x, the
ApModuleParent function only works with windows, and not dialogs.

Thanks
Rodney

Ben Burns <> bburns@nyab.com> > wrote:
This seems like there should be a simple solution, but I keep running
into
problems.
I have a base window where I am doing all my work. I have the option
to
open a dialog box that holds an RtTrend on it. I want to be able to
move it
to the side and if need be, have the base window on top covering over
the
dialog box with RtTrend on it.
I have tried every combination of flag settings I can think of, as
well
as
using the event.event commands and nothing seems to work.
I was able to manage a temporary solution moving the RtTrend to a
Window
from the dialog. And calling the event. But this ran into further
problems
as I tried to operate the controls on the base window, the trend
window
kept
wanting to jump to the front.

Surely there is an easy way to control this, that I am just missing.
If
anyone can help me, I sure would appreciate it. I am using Photon
1.13.

Ben Burns
\