mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-27 14:10:30 +00:00
builder-tool Make preview closeable
This commit is contained in:
parent
20b906cee8
commit
b92f4177aa
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user