[gnome-builder/wip/gtk4-port: 687/1774] libide/gtk: add widget destroyed helper




commit 943e0a77c9e5ca214831e3571432e38a667d54e4
Author: Christian Hergert <chergert redhat com>
Date:   Thu Apr 21 10:42:49 2022 -0700

    libide/gtk: add widget destroyed helper
    
    Since this is not in GTK anymore, but we can still use it, just make a
    copy of it ourselves to simplify porting for now.

 src/libide/gtk/ide-gtk.c | 8 ++++++++
 src/libide/gtk/ide-gtk.h | 2 ++
 2 files changed, 10 insertions(+)
---
diff --git a/src/libide/gtk/ide-gtk.c b/src/libide/gtk/ide-gtk.c
index a83367693..75e2fd1bb 100644
--- a/src/libide/gtk/ide-gtk.c
+++ b/src/libide/gtk/ide-gtk.c
@@ -373,3 +373,11 @@ ide_gtk_list_store_insert_sorted (GtkListStore     *store,
   else
     gtk_list_store_insert_after (store, iter, &middle);
 }
+
+void
+ide_gtk_widget_destroyed (GtkWidget  *widget,
+                          GtkWidget **location)
+{
+  if (location != NULL)
+    *location = NULL;
+}
diff --git a/src/libide/gtk/ide-gtk.h b/src/libide/gtk/ide-gtk.h
index 843cda571..b625410c2 100644
--- a/src/libide/gtk/ide-gtk.h
+++ b/src/libide/gtk/ide-gtk.h
@@ -52,5 +52,7 @@ void      ide_gtk_list_store_insert_sorted   (GtkListStore      *store,
                                               guint              compare_column,
                                               GCompareDataFunc   compare_func,
                                               gpointer           compare_data);
+void       ide_gtk_widget_destroyed          (GtkWidget         *widget,
+                                              GtkWidget        **location);
 
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]