Prepare for the new Terminator class

This commit is contained in:
Chris Jones 2009-08-11 00:15:31 +01:00
parent 49510266ed
commit b3635d2912
1 changed files with 15 additions and 6 deletions

View File

@ -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: