/** canmpdialog.c **/ #include void cancel_or_ok(gint reply,gpointer data); int main(int argc,char *argv[]) { GtkWidget *app; GtkWidget *dialog; GtkWidget *button; gnome_init("canmpdialog","1.0",argc,argv); app = gnome_app_new("canmpdialog","Question Dialog"); button = gtk_button_new_with_label("Button"); gtk_container_set_border_width(GTK_CONTAINER(app),30); gnome_app_set_contents(GNOME_APP(app),button); gtk_widget_show(button); gtk_widget_show(app); dialog = gnome_ok_cancel_dialog_modal_parented( "Do you really want to do this?", (GnomeReplyCallback)cancel_or_ok, NULL, GTK_WINDOW(app)); gtk_main(); exit(0); } void cancel_or_ok(gint reply,gpointer data) { if(reply == GNOME_CANCEL) g_print("Action cancelled\n"); else g_print("Action okayed\n"); }