On Thu, Jun 12, 2008 at 4:24 PM, Vladimir Giszpenc <[EMAIL PROTECTED]> wrote: > Hi, > > After reading on this list about the Dispose pattern as applied to > Gtk.Dialogs, I followed the lead of others. My problem is that in my > OK button I call a > bool Validate() function. When this function returns false, I want to > alert the user to what is wrong and NOT CLOSE. I return out of my > Click event, but someone else is generating a ResponseType.OK > response. > > How can I suppress the Response signal that is now leading to my > dialog getting closed? The .Netish thing to do would be a class that > inherits eventArgs on which I set some cancel = true. I know this not > to exist. > > Any ideas?
Set the response type of the button to None, and use Dialog.Respond to emit the OK response yourself after your validation succeeds. -- Chris Howie http://www.chrishowie.com http://en.wikipedia.org/wiki/User:Crazycomputers _______________________________________________ Gtk-sharp-list maillist - Gtk-sharp-list@lists.ximian.com http://lists.ximian.com/mailman/listinfo/gtk-sharp-list