Re: Gtk::Dialog::on_delete_event() is never called



> > > > I want to prevent that the user can close a dialog (derived from
> > > > Gtk::Dialog) by clicking on the X. I tried to override
> > > > on_delete_event():
> > It works with Gtk::Window, but it doesn't with Gtk::Dialog. Try the
> > following test program:
> When you use GtkDialog::run(), clicking the X doesn't result in a delete
> event, it causes the response signal to be emitted with
> RESPONSE_DELETE_EVENT.
> 
> What you want is probably something like
> 
> int result = Gtk::RESPONSE_NONE;
> while (result != Gtk::RESPONSE_DELETE_EVENT) {result = mydialog.run()}

Thank you.

In my opinion this is a design error of gtk. The caller of the dialog
should not have anything to do with dialog internals...

Bye, Tobias




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]