tThe new GtkTextView code now works under Win32. - vaccinewars - be a doctor and try to vaccinate the world
git clone git://src.adamsgaard.dk/vaccinewars
Log
Files
Refs
README
LICENSE
---
commit 5bc2874f49b1df87018825e7a32895c1529a6bb1
parent f6413a01369c0f249ab0695496bcf2e2281b0e57
Author: Ben Webb 
Date:   Fri,  5 Apr 2002 13:45:32 +0000

The new GtkTextView code now works under Win32.


Diffstat:
  M src/gtkport/gtkport.c               |      43 ++++++++++++++++---------------
  M src/gtkport/gtkport.h               |      12 ++++++------

2 files changed, 28 insertions(+), 27 deletions(-)
---
diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
t@@ -1836,12 +1836,11 @@ GtkWidget *gtk_text_new(GtkAdjustment *hadj, GtkAdjustment *vadj)
   return GTK_WIDGET(GtkNewObject(&GtkTextClass));
 }
 
-GtkWidget *gtk_scrolled_text_new(GtkAdjustment *hadj, GtkAdjustment *vadj,
-                                 GtkWidget **pack_widg)
+GtkWidget *gtk_scrolled_text_view_new(GtkWidget **pack_widg)
 {
   GtkWidget *text;
 
-  text = gtk_text_new(hadj, vadj);
+  text = gtk_text_new(NULL, NULL);
   *pack_widg = text;
   return text;
 }
t@@ -5118,24 +5117,6 @@ GtkWidget *gtk_scrolled_text_view_new(GtkWidget **pack_widg)
   return text;
 }
 
-void TextViewAppend(GtkTextView *textview, const gchar *text,
-                    const gchar *tagname, gboolean scroll)
-{
-  gint editpos;
-
-  editpos = gtk_text_get_length(GTK_TEXT(textview));
-  gtk_editable_insert_text(GTK_EDITABLE(textview), text, strlen(text),
-                           &editpos);
-  if (scroll) {
-    gtk_editable_set_position(GTK_EDITABLE(textview), editpos);
-  }
-}
-
-void TextViewClear(GtkTextView *textview)
-{
-  gtk_editable_delete_text(GTK_EDITABLE(textview), 0, -1);
-}
-
 #endif
 
 static void DestroyGtkMessageBox(GtkWidget *widget, gpointer data)
t@@ -5345,3 +5326,23 @@ GtkWidget *gtk_url_new(const gchar *text, const gchar *target,
 }
 
 #endif /* CYGWIN */
+
+#if CYGWIN || !HAVE_GLIB2
+void TextViewAppend(GtkTextView *textview, const gchar *text,
+                    const gchar *tagname, gboolean scroll)
+{
+  gint editpos;
+
+  editpos = gtk_text_get_length(GTK_TEXT(textview));
+  gtk_editable_insert_text(GTK_EDITABLE(textview), text, strlen(text),
+                           &editpos);
+  if (scroll) {
+    gtk_editable_set_position(GTK_EDITABLE(textview), editpos);
+  }
+}
+
+void TextViewClear(GtkTextView *textview)
+{
+  gtk_editable_delete_text(GTK_EDITABLE(textview), 0, -1);
+}
+#endif
diff --git a/src/gtkport/gtkport.h b/src/gtkport/gtkport.h
t@@ -792,12 +792,6 @@ void gtk_container_set_size(GtkWidget *widget, GtkAllocation *allocation);
 #define IDCANCEL  2
 #define IDYES     4
 #define IDNO      8
-
-#define gtk_text_view_set_editable(text, edit) gtk_text_set_editable(text, edit)
-#define gtk_text_view_set_wrap_mode(text, wrap) gtk_text_set_word_wrap(text, wrap)
-#define GTK_WRAP_WORD TRUE
-#define GTK_TEXT_VIEW(wid) GTK_TEXT(wid)
-#define GtkTextView GtkText
 #endif
 
 /* Other flags */
t@@ -829,6 +823,12 @@ typedef enum
   GTK_MESSAGE_QUESTION,
   GTK_MESSAGE_ERROR
 } GtkMessageType;
+
+#define gtk_text_view_set_editable(text, edit) gtk_text_set_editable(text, edit)
+#define gtk_text_view_set_wrap_mode(text, wrap) gtk_text_set_word_wrap(text, wrap)
+#define GTK_WRAP_WORD TRUE
+#define GTK_TEXT_VIEW(wid) GTK_TEXT(wid)
+#define GtkTextView GtkText
 #endif
 
 /* Global functions */