changeset 751:a022b57ed84a

[gaim-migrate @ 761] yay committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 23 Aug 2000 23:08:36 +0000
parents c4c4a18bb2f9
children 870fcc64a709
files src/dialogs.c
diffstat 1 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/dialogs.c	Wed Aug 23 20:37:16 2000 +0000
+++ b/src/dialogs.c	Wed Aug 23 23:08:36 2000 +0000
@@ -3053,7 +3053,17 @@
 		default: smiley_text = g_strndup(":-)", strlen(":-)")); break;
 	}
 	
-	surround(c->entry, smiley_text, "");
+	/* surround(c->entry, smiley_text, ""); */
+
+	if (GTK_EDITABLE(c->entry)->has_selection) {
+		int finish = GTK_EDITABLE(c->entry)->selection_end_pos;
+		gtk_editable_insert_text(GTK_EDITABLE(c->entry),
+					 smiley_text, strlen(smiley_text), &finish);
+	} else {
+		int pos = GTK_EDITABLE(c->entry)->current_pos;
+		gtk_editable_insert_text(GTK_EDITABLE(c->entry),
+					 smiley_text, strlen(smiley_text), &pos);
+	}
 
 	g_free(smiley_text);