gnome-control-center/panels/background/test-chooser-dialog.c
Debarshi Ray eaed418f2a background: Use a stack with three views for the chooser dialog
Instead of using a GtkGrid and GtkBox to mimic what GtkStack and
GtkStackSwitcher already does for us, let's just use the latter. As a
result each source now has its separate GtkIconView. The pictures
source has a nested GtkStack to switch between the 'empty' box and the
view, which should simplify size-related issues.

https://bugzilla.gnome.org/show_bug.cgi?id=736366
2014-09-12 13:08:13 +02:00

38 lines
883 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 (NULL);
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;
}