[gtk/window-destroy: 66/74] window: Add gtk_window_destroy



commit 69b5b52f0043176d33ce7017afc548d8ab1e5a7f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat May 9 09:30:29 2020 -0400

    window: Add gtk_window_destroy
    
    This is a replacement for gtk_widget_destroy for toplevels.
    For now, it is just a wrapper.

 docs/reference/gtk/gtk4-sections.txt |  1 +
 gtk/gtkwindow.c                      | 14 ++++++++++++++
 gtk/gtkwindow.h                      |  3 +++
 3 files changed, 18 insertions(+)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index d6995e8f4f..d03861889d 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -4190,6 +4190,7 @@ gtk_requisition_get_type
 GtkWindow
 GtkWindowClass
 gtk_window_new
+gtk_window_destroy
 gtk_window_get_child
 gtk_window_set_child
 gtk_window_set_title
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index decfa1778b..965d006397 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -7516,3 +7516,17 @@ gtk_window_get_child (GtkWindow *window)
 
   return priv->child;
 }
+
+/**
+ * gtk_window_destroy:
+ * @window: The window to destroy
+ *
+ * Drop the internal reference GTK holds on toplevel windows.
+ */
+void
+gtk_window_destroy (GtkWindow *window)
+{
+  g_return_if_fail (GTK_IS_WINDOW (window));
+
+  gtk_widget_destroy (GTK_WIDGET (window));
+}
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index 488a37c792..8a94876c95 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -254,6 +254,9 @@ GtkWidget *gtk_window_get_titlebar         (GtkWindow    *window);
 GDK_AVAILABLE_IN_ALL
 gboolean gtk_window_is_maximized           (GtkWindow    *window);
 
+GDK_AVAILABLE_IN_ALL
+void     gtk_window_destroy                (GtkWindow    *window);
+
 GDK_AVAILABLE_IN_ALL
 void     gtk_window_set_interactive_debugging (gboolean enable);
 


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