diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-07-20 10:13:47 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-07-20 10:13:47 (GMT) |
commit | d6ec6db8809659e827a2d5f6387451084e99338c (patch) | |
tree | 012f022e2116955cbc66be6536d4a4821af006f7 /shell/ConsoleWindow.py | |
parent | 87cb115aa0155291d2473537a3fa2da1400c174f (diff) |
Make the console contextual to the activity and use the
window manager to activate it.
Diffstat (limited to 'shell/ConsoleWindow.py')
-rw-r--r-- | shell/ConsoleWindow.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/shell/ConsoleWindow.py b/shell/ConsoleWindow.py new file mode 100644 index 0000000..b5d977e --- /dev/null +++ b/shell/ConsoleWindow.py @@ -0,0 +1,26 @@ +import gtk + +class ConsoleWindow(gtk.Window): + def __init__(self): + gtk.Window.__init__(self) + + self.set_default_size(620, 440) + self.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DIALOG) + self.set_title("Console") + self.connect("delete_event", lambda w, e: w.hide_on_delete()) + + sw = gtk.ScrolledWindow() + sw.set_policy(gtk.POLICY_AUTOMATIC, + gtk.POLICY_AUTOMATIC) + + self._console = gtk.TextView() + self._console.set_wrap_mode(gtk.WRAP_WORD) + sw.add(self._console) + self._console.show() + + self.add(sw) + sw.show() + + def log(self, message): + buf = self._console.get_buffer() + buf.insert(buf.get_end_iter(), message) |