changeset 5818:eb9cfee31244

[gaim-migrate @ 6248] I absolutely hate doing this, but as deleting a whole lot of text from a GtkTextView is slower than anything, we now delete the text view and re-add it when we want to clear the debug window. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 09 Jun 2003 02:04:05 +0000
parents 571e895bf6ba
children 7bdf66ab4fdd
files src/gtkdebug.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkdebug.c	Mon Jun 09 01:54:51 2003 +0000
+++ b/src/gtkdebug.c	Mon Jun 09 02:04:05 2003 +0000
@@ -77,7 +77,16 @@
 static void
 clear_cb(GtkWidget *w, DebugWindow *win)
 {
-	gtk_imhtml_clear(GTK_IMHTML(win->text));
+	GtkWidget *parent;
+
+	/* I HATE THIS! It's necessary though... Clearing a GtkTextView is SLOW. */
+	parent = gtk_widget_get_parent(win->text);
+
+	gtk_container_remove(GTK_CONTAINER(parent), win->text);
+
+	win->text = gtk_imhtml_new(NULL, NULL);
+	gtk_container_add(GTK_CONTAINER(parent), win->text);
+	gtk_widget_show(win->text);
 }
 
 static void