From 68b991404ee7bd3bde1300d456a46d863ff4d54a Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Sat, 22 Apr 2006 23:02:25 -0400 Subject: [PATCH] Set styles on current selection --- chat/richtext.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/chat/richtext.py b/chat/richtext.py index 925613de..7996547e 100644 --- a/chat/richtext.py +++ b/chat/richtext.py @@ -17,9 +17,15 @@ class RichTextBuffer(gtk.TextBuffer): def apply_tag(self, tag_name): self.active_tags.append(tag_name) + + [start, end] = self.get_selection_bounds() + self.apply_tag_by_name(tag_name, start, end) def unapply_tag(self, tag_name): self.active_tags.remove(tag_name) + + [start, end] = self.get_selection_bounds() + self.remove_tag_by_name(tag_name, start, end) def __create_tags(self): tag = self.create_tag("bold")