[gtk/wip/baedert/for-master] builder-tool Make preview closeable
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master] builder-tool Make preview closeable
- Date: Mon, 18 May 2020 12:03:26 +0000 (UTC)
commit af16972933f8cee431dc86e96b10011e9e76aa66
Author: Timm Bäder <mail baedert org>
Date: Mon May 18 14:02:32 2020 +0200
builder-tool Make preview closeable
gtk/tools/gtk-builder-tool-preview.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
---
diff --git a/gtk/tools/gtk-builder-tool-preview.c b/gtk/tools/gtk-builder-tool-preview.c
index 473aabd558..d40b9d96a3 100644
--- a/gtk/tools/gtk-builder-tool-preview.c
+++ b/gtk/tools/gtk-builder-tool-preview.c
@@ -50,6 +50,17 @@ set_window_title (GtkWindow *window,
g_free (name);
}
+static void
+quit_cb (GtkWidget *widget,
+ gpointer user_data)
+{
+ gboolean *is_done = user_data;
+
+ *is_done = TRUE;
+
+ g_main_context_wakeup (NULL);
+}
+
static void
preview_file (const char *filename,
const char *id,
@@ -59,6 +70,7 @@ preview_file (const char *filename,
GError *error = NULL;
GObject *object;
GtkWidget *window;
+ gboolean done = FALSE;
if (cssfile)
{
@@ -144,8 +156,9 @@ preview_file (const char *filename,
}
gtk_window_present (GTK_WINDOW (window));
+ g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done);
- while (TRUE)
+ while (!done)
g_main_context_iteration (NULL, TRUE);
g_object_unref (builder);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]