From b3635d29128ee2c3a661c8af58ac2f5cdd052170 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 11 Aug 2009 00:15:31 +0100 Subject: [PATCH] Prepare for the new Terminator class --- terminatorlib/window.py | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 736bb5dc..a70053b4 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -11,6 +11,7 @@ import gtk from util import dbg, err from version import APP_NAME from container import Container +from newterminator import Terminator try: import deskbar.core.keybinder as bindkey @@ -21,6 +22,7 @@ except ImportError: class Window(Container, gtk.Window): """Class implementing a top-level Terminator window""" + terminator = None title = None isfullscreen = None ismaximised = None @@ -29,6 +31,8 @@ class Window(Container, gtk.Window): def __init__(self, configobject): """Class initialiser""" + self.terminator = Terminator() + Container.__init__(self, configobject) gtk.Window.__init__(self) gobject.type_register(Window) @@ -40,6 +44,8 @@ class Window(Container, gtk.Window): self.register_callbacks() self.apply_config() + self.default_setup() + def register_callbacks(self): """Connect the GTK+ signals we care about""" self.connect('key-press-event', self.on_key_press) @@ -85,6 +91,15 @@ class Window(Container, gtk.Window): self.set_icon(icon) + def default_setup(self): + """Set up the default child widget""" + terminal = self.terminator.new_terminal() + + self.add(terminal) + terminal.hide_titlebar() + self.show() + terminal.spawn_child() + def on_key_press(self, window, event): """Handle a keyboard event""" pass @@ -197,10 +212,4 @@ CONFIG = {'fullscreen':False, } } -WINDOW = Window(CONFIG) -WINDOWTITLE = WindowTitle(WINDOW) -WINDOWTITLE.update() -WINDOW.show_all() -gtk.main() - # vim: set expandtab ts=4 sw=4: