Re: About Dialog : Close button to close dialog?



Thanks all,

I think that calling run() instead of show() should do the trick.
I'll look at the on_response() signal handler too if run() doesn't solve it.

Will post a response when I've this sorted :) -Harry

On Fri, Mar 23, 2012 at 6:17 PM, Robert Pearce <rob bdt-home demon co uk> wrote:

On Fri, 23 Mar 2012 10:14:50 -0700 Ed wrote:
> On Thu, 22 Mar 2012 20:15:59 +0000
> harryhaaren gmail com wrote:
>
<snip>
> > A simple "aboutDialog->show();" shows the dialog, but when I click
> > the close button it doesn't do anything.

<snip>

> -- Hmm. I gather the widget is a Gtk::AboutDialog. I have a program
> using a stock Gtk::AboutDialog (in a Glade file) that runs:
<snip>
>       int response = _about_dialog->run();
<snip>
> -- I gather you are doing something along those lines.

Actually I gather he's doing something different in the places I left
in....

Dialog boxes are generally optimised to be used in one of two ways:
1) as a modal dialog, where you add some buttons with associated
values, call the "run" method as Ed did, and get a return value
corresponding to the button.
2) as a non-modal dialog, where you use to "show" method as Harry did,
but you also override the dialog class's "on_response" method to handle
the button presses.

In both cases you need to do the hiding yourself, for example after
calling "run" or within the on_response method.

HTH
Rob
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list



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