Re: About Gtk::MessageDialog



On Fri, 2007-03-23 at 20:14 +1100, Michael J M Thomson wrote:
> Ole Laursen wrote:
> > "Leonel Salazar Videaux" <lsalazar estudiantes uci cu> writes:
> > 
> >> Hello everyone, I just create a small program and need to show a
> >> message to the user, all is fine untill I saw that my program shows
> >> the dialog, but not close it by the Gtk::BUTTONS_OK, only pressing
> >> Close in the title bar, what can I do for see the OK button closing
> >> the MessageDialog ? 
> > 
> > If you haven't found out already, you need to show us the minimal
> > amount of code that doesn't work.
> > 
> No need, all they have to do is hide the dialog after running it:
> 
> 	Gtk::MessageDialog d(...);
> 	int response = d.run();
> 	d.hide();
> 	... handle response ...
> 
> It's not obvious, but dialogs don't do this automatically as it might not always
> be the desired behaviour.

and note that in the case above, if the ellipsized code doesn't do a
whole lot, even the d.hide() is unnecessary, since d will be hidden when
it goes out of scope and is deleted.





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