From 20d7582f1d55b6523d1ac041c0ce2d2d8580788b Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 12 Jun 2006 20:22:12 -0400 Subject: [PATCH] Add scrollbars to the console, wrap word --- sugar/shell/shell.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sugar/shell/shell.py b/sugar/shell/shell.py index fae10f88..5ee355d8 100755 --- a/sugar/shell/shell.py +++ b/sugar/shell/shell.py @@ -337,14 +337,28 @@ class ConsoleLogger(dbus.service.Object): else: self._window.show() + def _create_console(self, application): + sw = gtk.ScrolledWindow() + sw.set_policy(gtk.POLICY_AUTOMATIC, + gtk.POLICY_AUTOMATIC) + + console = gtk.TextView() + console.set_wrap_mode(gtk.WRAP_WORD) + + sw.add(console) + console.show() + + self._nb.append_page(sw, gtk.Label(application)) + sw.show() + + return console + @dbus.service.method('com.redhat.Sugar.Logger') def log(self, application, message): if self._consoles.has_key(application): console = self._consoles[application] else: - console = gtk.TextView() - self._nb.append_page(console, gtk.Label(application)) - console.show() + console = self._create_console(application) self._consoles[application] = console buf = console.get_buffer()