[gtk+/gtk-2.90] Substitute gtk_widget_ref/unref with g_object_ref/unref



commit a82a62b600e5f69bcc6555b2cf66918d7aa0a904
Author: Javier Jardón <javierjc1982 gmail com>
Date:   Mon Oct 12 15:59:45 2009 +0200

    Substitute gtk_widget_ref/unref with g_object_ref/unref
    
    Substitute the use of gtk_widget_ref/unref in documentation examples
    and in internal gtk+ code
    
    https://bugzilla.gnome.org/show_bug.cgi?id=598218

 docs/developers.txt              |    9 ---------
 docs/faq/gtk-faq.sgml            |    4 ++--
 docs/refcounting.txt             |    8 ++++----
 docs/tutorial/gtk_tut.sgml       |    4 ++--
 docs/tutorial/gtk_tut_12.es.sgml |    4 ++--
 5 files changed, 10 insertions(+), 19 deletions(-)
---
diff --git a/docs/developers.txt b/docs/developers.txt
index e50c8ca..66e1d93 100644
--- a/docs/developers.txt
+++ b/docs/developers.txt
@@ -48,15 +48,6 @@ Events that are assured to have a valid GdkEvent.any.window field are
 GDK_EXPOSE		GtkWidget::expose_event
 
 
-gtk_widget_ref() vs. gtk_object_ref()
--------------------------------------
-
-The widget referencing functions gtk_widget_ref() and gtk_widget_unref()
-are currently just wrappers about the corresponding referencing functions
-for objects. Still you should use the widget referencing functions if you
-are sure the referenced object is of type GTK_WIDGET_TYPE.
-
-
 Writing Gdk functions
 ---------------------
 
diff --git a/docs/faq/gtk-faq.sgml b/docs/faq/gtk-faq.sgml
index b90f540..01c71d3 100644
--- a/docs/faq/gtk-faq.sgml
+++ b/docs/faq/gtk-faq.sgml
@@ -2108,10 +2108,10 @@ not.</para>
 snippet:</para>
 
 <programlisting role="C">
-     gtk_widget_ref(widget);
+     g_object_ref(widget);
      gtk_container_remove(GTK_CONTAINER(old_parent), widget);
      gtk_container_add(GTK_CONTAINER(new_parent), widget);
-     gtk_widget_unref(widget);
+     g_object_unref(widget);
 </programlisting>
 
 </sect1>
diff --git a/docs/refcounting.txt b/docs/refcounting.txt
index f8b62ed..5ebf818 100644
--- a/docs/refcounting.txt
+++ b/docs/refcounting.txt
@@ -250,12 +250,12 @@ Example code sequences that require reference wraps:
    /* gtk_container_remove() will unparent the child and therefore
     * cause its reference count to be decremented by one.
     */
-   gtk_widget_ref (widget);
+   g_object_ref (widget);
    gtk_container_remove (container, widget);
    /* without the reference count, the widget would have been destroyed here.
    */
    gtk_container_add (container, widget);
-   gtk_widget_unref (widget);
+   g_object_unref (widget);
 
 
   /* all items in item_list need to be referenced
@@ -267,7 +267,7 @@ Example code sequences that require reference wraps:
    slist = NULL;
    for (list = item_list; list; list = list->next)
    {
-     gtk_widget_ref (GTK_WIDGET (list->data));
+     g_object_ref (GTK_WIDGET (list->data));
      slist = g_slist_prepend (slist, list->data);
    }
    gtk_list_remove_items (list, item_list);
@@ -280,7 +280,7 @@ Example code sequences that require reference wraps:
      
      tmp = slist;
      slist = slist->next;
-     gtk_widget_unref (GTK_WIDGET (tmp->data));
+     g_object_unref (GTK_WIDGET (tmp->data));
      g_slist_free_1 (tmp);
    }
    
diff --git a/docs/tutorial/gtk_tut.sgml b/docs/tutorial/gtk_tut.sgml
index 0d69c21..4833db8 100644
--- a/docs/tutorial/gtk_tut.sgml
+++ b/docs/tutorial/gtk_tut.sgml
@@ -9553,7 +9553,7 @@ which owns it will be collapsed. So, if you want it to stick around,
 do something like the following:
 
 <tscreen><verb>
-gtk_widget_ref (tree);
+g_object_ref (tree);
 owner = GTK_TREE(tree)->tree_owner;
 gtk_container_remove (GTK_CONTAINER(tree), item);
 if (tree->parent == NULL){
@@ -9561,7 +9561,7 @@ if (tree->parent == NULL){
   gtk_tree_item_set_subtree (GTK_TREE_ITEM(owner), tree);
 }
 else
-  gtk_widget_unref (tree);
+  g_object_unref (tree);
 </verb></tscreen>
 
 Finally, drag-n-drop <em>does</em> work with TreeItems. You just
diff --git a/docs/tutorial/gtk_tut_12.es.sgml b/docs/tutorial/gtk_tut_12.es.sgml
index fdfeffb..4641c1f 100755
--- a/docs/tutorial/gtk_tut_12.es.sgml
+++ b/docs/tutorial/gtk_tut_12.es.sgml
@@ -8981,7 +8981,7 @@ se colapsar
 tendrá que hacer algo así:
 
 <tscreen><verb>
-gtk_widget_ref (arbol);
+g_object_ref (arbol);
 propietario = GTK_TREE(arbol)->tree_owner;
 gtk_container_remove (GTK_CONTAINER(arbol), item);
 if (arbol->parent == NULL){
@@ -8989,7 +8989,7 @@ if (arbol->parent == NULL){
   gtk_tree_item_set_subtree (GTK_TREE_ITEM(propietario), arbol);
 }
 else
-  gtk_widget_unref (arbol);
+  g_object_unref (arbol);
 </verb></tscreen>
 
 Finalmente, hay que mencionar que la opción de drag-n-drop (arrastar y



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