gnome-control-center/panels/background/test-chooser-dialog.c
Debarshi Ray 176e8c3057 background: Make it possible to use gtkparasite with the test
The dialog has to be non-modal for us to be able to inspect it with
gtkparasite.
2013-10-03 12:59:18 +02:00

38 lines
879 B
C

#include <gtk/gtk.h>
#include "cc-background-chooser-dialog.h"
static void
on_dialog_response (GtkDialog *dialog,
int response_id,
gpointer user_data)
{
g_debug ("response: %d", response_id);
if (response_id == GTK_RESPONSE_OK) {
CcBackgroundItem *item;
item = cc_background_chooser_dialog_get_item (CC_BACKGROUND_CHOOSER_DIALOG (dialog));
cc_background_item_dump (item);
g_object_unref (item);
}
gtk_widget_destroy (GTK_WIDGET (dialog));
gtk_main_quit ();
}
int main (int argc, char **argv)
{
GtkWidget *dialog;
g_setenv ("G_MESSAGES_DEBUG", "all", TRUE);
gtk_init (&argc, &argv);
dialog = cc_background_chooser_dialog_new ();
gtk_window_set_modal (GTK_WINDOW (dialog), FALSE);
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (on_dialog_response), NULL);
gtk_widget_show_all (dialog);
gtk_main ();
return 0;
}