Re: Control Closing of Gtk::Dialog



On Sun, 15 Feb 2009, Murray Cumming <murrayc murrayc com> wrote :
On Sun, 2009-02-15 at 15:51 +0100, Jon Black wrote:
I have a simple Gtk::Dialog with 3 text entry fields, a cancel button,
and an ok button. I'd like the dialog to close whenever the user
presses cancel, and when the user presses ok only if all the text
entry fields contain text.
<snip>

I think you can override on_response() to prevent run() from returning.
I forget the details.

As an alternative (slight change to behaviour) you could hook up to the "on change" signals of the text fields, and set the OK button's sensitivity according to their new contents. Thus the OK button would be greyed out until it's valid to press. It's a bit more work but some might think it's a nicer user interface.
--
Rob Pearce                       http://www.bdt-home.demon.co.uk

The contents of this | Windows NT crashed.
message are purely   | I am the Blue Screen of Death.
my opinion. Don't    | No one hears your screams.
believe a word.      |


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