[Gtk-sharp-list] How do I keep main window from closing?

Adam Tauno Williams awilliam at whitemice.org
Mon Jul 20 22:41:57 EDT 2009

On Mon, 2009-07-20 at 15:51 -0700, bdubu wrote:
> I have a TextView on my main window.  I don't want to be able to close the
> main window if the text in this TextView has been modified but not yet saved
> to disk.  I realize I can check the control's Buffer.Modified property and
> that this should likely be done in the main windows's OnDeleteEvent handler
> but I don't know how to make this work.  I took a WAG and tried this...


protected void OnDeleteEvent (object sender, DeleteEventArgs a)

then interrupt the callback chain by setting a.RetVal = false; [ or is
it a.RetVal = true; ]  one of those.  Those should make your callback
first and stop the default callback from executing.

I think.

> ... but the main window closes even though the Modified property is true and
> I answer "no" to the dialog's question, "Abandon changes?".  Can someone
> shed some light on how I should go about this?  Thanks!

OpenGroupware developer: awilliam at whitemice.org
OpenGroupare & Cyrus IMAPd documenation @

More information about the Gtk-sharp-list mailing list