Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » BUG: "Close();" does not!
Re: "Close();" does not! [message #41881 is a reply to message #41880] |
Mon, 03 February 2014 14:22 |
Oblivion
Messages: 1093 Registered: August 2007
|
Senior Contributor |
|
|
As Shire already mentioned, and as far as I know, you cannot directly call the TopWindow::Close() from an inner event loop (but it seems relatively safe, since if called from an inner loop, Close() method does nothing and simply returns). I might be wrong, but afaik, buttons, top menu etc. does not have a seperate event loop, they pass their events to their parent (here, TopWindow). On the other hand, popup menu and modal dialogues have an inner loop (you can see they are invoked by methods such as Do(), Run(), Execute())
For example, you could have called Close() if the menu was a direct children of topwindow (a top menu). In this case, you are calling from inside an popup menu of ArrayCtrl (which probably invokes the MenuBar::Execute() method) , so you need to break the top level event loop "explicitly". Use TopWindow::Break().
void testclose::DoClose()
{
// Breaks the TopWindow event loop.
Break();
}
Also, note that TopWindow::Close() method is virtual, you can override it to suit your needs.
Regards.
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Mon, 03 February 2014 14:52] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Fri May 10 00:46:14 CEST 2024
Total time taken to generate the page: 0.03250 seconds
|