exit app with splashscreen not working

I’m not understanding something. I’m trying to get a splash screen on my application. When the splash screen is disabled, everything works fine. But once I put the splash screen in the app, I can’t close the app. I get “NameError: global name ‘app’ is not defined”. If I comment out the line “app.OnClose()” the main loop doesn’t terminate when I close the program. Does the splash screen somehow kill the instance of App?

How am I supposed to do this?

Thanks for the help!

splashtest.py (962 Bytes)

Your code works fine for me (once I supplied a bitmap).

Are you using Classic or Phoenix? What OS and toolkit?

···

On Tue, 21 Jun 2016, Neil Thornock wrote:

I'm not understanding something. I'm trying to get a splash screen on my
application. When the splash screen is disabled, everything works fine. But
once I put the splash screen in the app, I can't close the app. I get
"NameError: global name 'app' is not defined". If I comment out the line
"app.OnClose()" the main loop doesn't terminate when I close the program.
Does the splash screen somehow kill the instance of App?
How am I supposed to do this?

Thanks for the help!

I’m using Classic on Mac.

I worked around the problem using the attached, moving the splash outside the rest of the code, but it seems like bad style – ? Is there something bad about this solution? Anything better I should be doing?

Thank you, Scott, for the reply.

splashtest.py (925 Bytes)

···

On Tue, Jun 21, 2016 at 6:12 PM, Scott Talbert swt@techie.net wrote:

On Tue, 21 Jun 2016, Neil Thornock wrote:

I’m not understanding something. I’m trying to get a splash screen on my

application. When the splash screen is disabled, everything works fine. But

once I put the splash screen in the app, I can’t close the app. I get

“NameError: global name ‘app’ is not defined”. If I comment out the line

“app.OnClose()” the main loop doesn’t terminate when I close the program.

Does the splash screen somehow kill the instance of App?

How am I supposed to do this?

Thanks for the help!

Your code works fine for me (once I supplied a bitmap).

Are you using Classic or Phoenix? What OS and toolkit?