|
|
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Exit app from menu on control in Tab
Exit app from menu on control in Tab [message #58131] |
Fri, 25 February 2022 09:44  |
slashupp
Messages: 231 Registered: July 2009
|
Experienced Member |
|
|
I want to exit the app from a menu-item on an ArrayCtrl::WhenBar-handler in a TabCtrl in the main window.
I am using bar.Add("Exit", [&]{ Break(); }); --- bug - assertion fails
I also tried bar.Add("Exit", [=]{ Break(); }); but get same error
What is the right way to do so?
|
|
|
|
Re: Exit app from menu on control in Tab [message #58170 is a reply to message #58169] |
Mon, 07 March 2022 11:50   |
slashupp
Messages: 231 Registered: July 2009
|
Experienced Member |
|
|
Thanks for the suggestion.
Unfortunately does not work either, and/but I don't get any error-message either, it just does nothing.
(I tried it before with overriding 'Close()' in the mainclass as well)
I debug-traced the execution-calls, it follows:
TopWindow::Close()
Ctrl::IgnoreMouseUp()
Ctrl::Close() - which it completes to '... popup = false; }'
(and then seems to go on with standard Upp processing, I think)
and then nothing happens, the app still runs.
I tried with & without GuiLock __; and also in Release-mode - still fails to close the app
(the app needs to close in a controlled way because a class needs to update a db on dtor)
[Updated on: Mon, 07 March 2022 11:53] Report message to a moderator
|
|
|
|
Re: Exit app from menu on control in Tab [message #58172 is a reply to message #58171] |
Mon, 07 March 2022 12:05   |
slashupp
Messages: 231 Registered: July 2009
|
Experienced Member |
|
|
I checked GeoFun just now...
(It works in my app if put an arrayctrl directly in the mainclass) BUT ...
The big/main difference is that I've got a TabCtrl(several tabs) and in a tab there
is a ArrayCtrl as child. It is from the popup-menu on this child arrayctrl that I want to
be able to close the app. I use a pointer to the main-class instance where the Exit()(or /Close())
method is defined to make the call from the lambda. This is what fails.
[Updated on: Mon, 07 March 2022 12:06] Report message to a moderator
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 22 00:15:23 CEST 2023
Total time taken to generate the page: 0.01731 seconds
|
|
|