From 65971425cca59a0f246f6c6d1338c9ae6218f455 Mon Sep 17 00:00:00 2001 From: Marc Maurer Date: Fri, 01 Dec 2006 00:37:56 +0000 Subject: The start of the new abiword activity, using the python bindings to build the interface (patch from Tomeu Vizoso, tweaked by me) --- (limited to 'AbiWordActivity.py') diff --git a/AbiWordActivity.py b/AbiWordActivity.py index 24fb415..ebb63aa 100755 --- a/AbiWordActivity.py +++ b/AbiWordActivity.py @@ -1,29 +1,12 @@ - import logging import os import time import gtk +from abiword import Canvas from sugar.activity.Activity import Activity - -class AbiWord (gtk.Socket): - - def __init__ (self): - gtk.Socket.__init__ (self) - - self.connect ('realize', self.realize_cb) - - - def realize_cb (self, event): - - params = [ - 'abiword', - '--nosplash', - '--gtk-socket-id=' + str (self.get_id ()) - ] - os.spawnvp (os.P_NOWAIT, 'abiword', params) - +from toolbar import Toolbar class AbiWordActivity (Activity): @@ -32,6 +15,16 @@ class AbiWordActivity (Activity): self.set_title ("AbiWord") - abiword = AbiWord () - self.add (abiword) - abiword.show_all () + hbox = gtk.HBox(False, 0) + self.add(hbox) + hbox.show() + + abiword_canvas = Canvas() + + toolbar = Toolbar(abiword_canvas) + hbox.pack_start(toolbar, False) + toolbar.show() + + hbox.add(abiword_canvas) + abiword_canvas.set_property("load-file", "") + abiword_canvas.show() -- cgit v0.9.1