When the window closes, the user is asked to save the file that they edited. They should also have an option to cancel quitting the application.
In WPF I can set the CancelEventArgs.Cancel property to true to do this. Is there an equivalent/workaround in Gtk#?
You need to set the DeleteEventArgs.RetVal to true, not false. From the relevant Mono documentation:
To keep a Gtk.Window
from closing, set Gtk.DeleteEventHandler
's Gtk.DeleteEventArgs.RetVal
to true
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With