Photon window destroy

Hi,

This is Suresh, and I am too new using Photon.
In one of my project i want to open one window at startup time,
after 5 seconds it should close automatically and pop-up new window.
Iam using ptTimer widget for this application and i am to get second
window, but i am unable to destroy first window.
Please help me out.

Regards,
K.Suresh Kumar

Hi Suresh,

You could use the following function to destroy the first window,
PtDestroyWidget(widget). Where widget is the ABW_first_window name.

Regards
Brenda

“Kavula Suresh Kumar” <skavula@nordson.com> wrote in message
news:btjcnm$ioo$1@inn.qnx.com

Hi,

This is Suresh, and I am too new using Photon.
In one of my project i want to open one window at startup time,
after 5 seconds it should close automatically and pop-up new window.
Iam using ptTimer widget for this application and i am to get
second
window, but i am unable to destroy first window.
Please help me out.

Regards,
K.Suresh Kumar

GUI wrote:

Hi Suresh,

You could use the following function to destroy the first window,
PtDestroyWidget(widget). Where widget is the ABW_first_window name.

Can you destroy the base window ie the first window opened?
I always just open up the next window, it will overlap the previous.

Hi Suresh,

I guess I should have asked if it was the base window of your application
that you were opening first, if it is you should use PtUnRealizeWidget()
function because once you destroy your base window your whole application
will close.
What is your first window doing that you want to close it, is it a splash
screen of some sort?

Regards
Brenda

<acellarius@yahoo.com> wrote in message news:3FFD927F.C8AE4BA8@yahoo.com

GUI wrote:

Hi Suresh,

You could use the following function to destroy the first window,
PtDestroyWidget(widget). Where widget is the ABW_first_window name.

Can you destroy the base window ie the first window opened?
I always just open up the next window, it will overlap the previous.

acellarius@yahoo.com wrote:

GUI wrote:
You could use the following function to destroy the first window,
PtDestroyWidget(widget). Where widget is the ABW_first_window name.

Can you destroy the base window ie the first window opened?

Yes, you can, but then there’s a good chance that another window you
create will become the base window. The rules are somewhat tricky:

If you have a base window, it’s the default parent for any window or
dialog modules you create. Destroying a window also destroys any
child windows it has.

If you don’t have a base window, a PhAB window callback (but not a
dialog callback) will turn the new window into a base window.

But if you create a window by calling ApCreateModule(), it will
not become a base window.


Here’s how I would do what you want to do:

In PhAB, set up your application to have an initialization function
but no base window at startup.

In your app’s initialization function, call ApCreateModule() to open
the first window. This window will not become your base window.

Put a PtTimer widget in the first window. Give it a window-type
callback that opens the second window. This will make it a base
window.

In the second window’s setup function, destroy the first window.
(Make it a post-realize function to prevent flicker from the
background drawing when the first window is already gone but the
second window isn’t realized yet.)

Thank Mr. Wojtek Lerch
It’s Working


“Wojtek Lerch” <wojtek_l@yahoo.ca> wrote in message
news:btk5v2$l6j$1@nntp.qnx.com

acellarius@yahoo.com > wrote:
GUI wrote:
You could use the following function to destroy the first window,
PtDestroyWidget(widget). Where widget is the ABW_first_window name.

Can you destroy the base window ie the first window opened?

Yes, you can, but then there’s a good chance that another window you
create will become the base window. The rules are somewhat tricky:

If you have a base window, it’s the default parent for any window or
dialog modules you create. Destroying a window also destroys any
child windows it has.

If you don’t have a base window, a PhAB window callback (but not a
dialog callback) will turn the new window into a base window.

But if you create a window by calling ApCreateModule(), it will
not become a base window.


Here’s how I would do what you want to do:

In PhAB, set up your application to have an initialization function
but no base window at startup.

In your app’s initialization function, call ApCreateModule() to open
the first window. This window will not become your base window.

Put a PtTimer widget in the first window. Give it a window-type
callback that opens the second window. This will make it a base
window.

In the second window’s setup function, destroy the first window.
(Make it a post-realize function to prevent flicker from the
background drawing when the first window is already gone but the
second window isn’t realized yet.)