Re: About Dialog : Close button to close dialog?
- From: Robert Pearce <rob bdt-home demon co uk>
- To: gtkmm-list gnome org
- Subject: Re: About Dialog : Close button to close dialog?
- Date: Fri, 23 Mar 2012 18:17:11 +0000
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]