Skip to content

Commit

Permalink
examples: Port to async dialog API
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Clasen committed Oct 29, 2022
1 parent 4248380 commit 8bee62d
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions examples/action-namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,11 @@ action_activated (GSimpleAction *action,
gpointer user_data)
{
GtkWindow *parent = user_data;
GtkWidget *dialog;
GtkAlertDialog *dialog;

dialog = gtk_message_dialog_new (parent,
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_INFO,
GTK_BUTTONS_CLOSE,
"Activated action `%s`",
g_action_get_name (G_ACTION (action)));

g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_window_destroy), dialog);

gtk_widget_show (dialog);
dialog = gtk_alert_dialog_new ("Activated action `%s`", g_action_get_name (G_ACTION (action)));
gtk_alert_dialog_show (dialog, NULL);
g_object_unref (dialog);
}

static GActionEntry doc_entries[] = {
Expand Down

0 comments on commit 8bee62d

Please sign in to comment.