gtktextbuffer patch



I've attached a small patch for gtktextbuffer.[hc].  It moves the
initialisation code from the _new function to a _construct function.
Since the function access the underlying btree, this is needed to be
able to subclass the object.

        /mailund



===File ~/src/gtk+/gtk/gtktextbuffer.patch==================
--- gtktextbuffer.h	Tue Jun 13 21:56:57 2000
+++ gtktextbuffer.h.patched	Tue Jun 13 22:13:16 2000
@@ -90,6 +90,8 @@
 
 /* table is NULL to create a new one */
 GtkTextBuffer *gtk_text_buffer_new            (GtkTextTagTable *table);
+void           gtk_text_buffer_construct      (GtkTextBuffer   *text_buffer,
+					       GtkTextTagTable *table);
 gint           gtk_text_buffer_get_line_count (GtkTextBuffer   *buffer);
 gint           gtk_text_buffer_get_char_count (GtkTextBuffer   *buffer);
 
--- gtktextbuffer.c	Tue Jun 13 21:56:57 2000
+++ gtktextbuffer.c.patched	Tue Jun 13 22:13:21 2000
@@ -260,17 +260,14 @@
 			     targets, n_targets);
 }
 
-GtkTextBuffer*
-gtk_text_buffer_new (GtkTextTagTable *table)
+void
+gtk_text_buffer_construct (GtkTextBuffer *text_buffer,
+			   GtkTextTagTable *table)
 {
-  GtkTextBuffer *text_buffer;
-
   /* This is broken, need construct_only argument for the tag table
      so language bindings can set it.
   */
   
-  text_buffer = GTK_TEXT_BUFFER (gtk_type_new (gtk_text_buffer_get_type ()));
-
   if (table)
     text_buffer->tag_table = table;
   else
@@ -281,9 +278,19 @@
   
   text_buffer->tree = gtk_text_btree_new(text_buffer->tag_table,
                                          text_buffer);  
-  
+}
+
+GtkTextBuffer*
+gtk_text_buffer_new (GtkTextTagTable *table)
+{
+  GtkTextBuffer *text_buffer;
+
+  text_buffer = GTK_TEXT_BUFFER (gtk_type_new (gtk_text_buffer_get_type ()));
+  gtk_text_buffer_construct (text_buffer, table);
+
   return text_buffer;
 }
+
 
 static void
 gtk_text_buffer_destroy (GtkObject *object)
============================================================




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