-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to intercept / veto window close #467
Comments
This is a slightly complicated area because macOS, other desktop and mobile devices all handle it differently. Yes we should support localisation, that needs to be done correctly for the whole framework, however. There is currently an OnClosed handler on Window that may help - but it seems like what you want is something to fire before closing that determines whether or not it should be allowed? (Is they correct?) I suspect that configuring the quit menu is not the right approach because the window could be manually closed as well and that should probably trigger the same event..? |
Correct.
That sounds logical. Maybe even a general purpose interface for hooking onto window management events? |
I don’t know if we can really extend it that far as the events vary significantly across platforms. We can certainly add an abstraction where such support makes sense. Starting with WillClose to complement OnClose perhaps? (Unless anyone suggests a better name) |
WillClose sounds great. |
This may not be the desired solution as it commits to close as soon as there are no windows. A future change could address fyne-io#467 to add a veto-close function.
This may not be the desired solution as it commits to close as soon as there are no windows. A future change could address #467 to add a veto-close function.
This was completed a while back :) |
Is there a way to turn off the "Quit" option added to the gl driver's first main-menu menu?
fyne/internal/driver/gl/menu.go
Line 33 in 0f43af5
Alternatively, a way to:
The text was updated successfully, but these errors were encountered: