gnome-control-center/panels/background/test-chooser-dialog.c
Robert Ancell d2d8a501cd background: Don't use gtk_widget_show_all
It is removed in GTK+ 4
2018-10-10 04:01:11 +00:00

37 lines
871 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) {
g_autoptr(CcBackgroundItem) item = NULL;
item = cc_background_chooser_dialog_get_item (CC_BACKGROUND_CHOOSER_DIALOG (dialog));
cc_background_item_dump (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 (dialog);
gtk_main ();
return 0;
}