Re: Imperfect Understanding

new topic     » goto parent     » topic index » view thread      » older message » newer message

Your understanding is mostly correct. Routines calling each other build a "stack" which is basically a running list of routine calls. So in this case you're looking at a stack like this:

Level 1: <TopLevel> 
  Level 2: message_box() 
Level 1: <TopLevel> 
  Level 2: closeApp() 
    Level 3: closeWindow() 

But that's not the problem here. I think your code is running as designed but you're not aware of what closeApp() is designed to do.

The closeApp() routine is very simple: it checks if the application has a main window and if so, it tells that window to close. It's just shorthand for you calling closeWindow(MyWindow) directly.

When the Win32Lib docs talk about the "app" it doesn't mean the entire program of Euphoria code; it's specifically referring to everything running inside the event loop handled by WinMain().

So if you're calling closeApp() before you've started the "app" by calling WinMain(), then closeApp() will do nothing for you. In that case you're better off using abortErr() to force the entire program to stop.

-Greg

P.S. I updated your post to correct the formatting. Using <eucode> tags helps format code. And you don't need to use double-backslash \\ for line breaks; a simple empty line will suffice. You can click Edit on your post to see my changes.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu