[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: message dialog box/signal question
- From: Drew Parsons <dparsons emerall com>
- To: gtk-app-devel-list gnome org
- Subject: Re: message dialog box/signal question
- Date: Thu, 2 Jan 2003 23:51:07 +1000
On Wed, Jan 01, 2003 at 11:32:03PM -0700, Casey Creighton wrote:
> I can't seem to figure out what selection the user chose when presented with a
> message dialog box, here is the code creating the widget.
>
Sounds like you want to check the return value of gtk_dialog_run.
> GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(window),
> GTK_DIALOG_DESTROY_WITH_PARENT,
> GTK_MESSAGE_QUESTION,
> GTK_BUTTONS_YES_NO,
> "Current message changed, would you like to save it?");
gint choice;
> g_signal_connect(GTK_OBJECT (dialog), "response",
> G_CALLBACK (saveCallback), ???);
> gtk_dialog_run (GTK_DIALOG (dialog));
^^
choice = gtk_dialog_run(...)
> gtk_widget_destroy (dialog);
>
The return value will be a standard value corresponding to YES or NO (check
the docs on GTK_BUTTONS_YES_NO).
> as you can see there is the ??? as the 4th param for g_signal_connect(), i
> don't know what to pass there, or how to get the data.
You don't need g_signal_connect for these special dialog boxes, since they
only exist during gtk_dialog_run(), waiting for a response. gtk_dialog_run()
takes cares of all the dialog box details for you.
Drew
--
PGP public key available at http://people.debian.org/~dparsons/drewskey.txt
Fingerprint: A110 EAE1 D7D2 8076 5FE0 EC0A B6CE 7041 6412 4E4A
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]