diff options
Diffstat (limited to 'mindmapactivity.py')
-rwxr-xr-x | mindmapactivity.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/mindmapactivity.py b/mindmapactivity.py index e972f79..4a5e2b2 100755 --- a/mindmapactivity.py +++ b/mindmapactivity.py @@ -17,6 +17,7 @@ import logging from gettext import gettext as _ +import gobject import gtk from sugar.activity import activity @@ -27,6 +28,9 @@ from view import MindMapView from treeview import TreeView class MindMapActivity(activity.Activity): + + __gtype_name__ = 'MindMapActivity' + def __init__(self, handle): activity.Activity.__init__(self, handle) @@ -54,6 +58,18 @@ class MindMapActivity(activity.Activity): pane.pack2(self._view) self._view.show() + if handle.object_id is None: + gobject.idle_add(self.__add_first_thought_cb) + + def __add_first_thought_cb(self): + x, y, width, height = self._view.get_allocation() + #TODO: place better the first thought + thought_id = self._model.create_new_thought(name=_('Initial thought'), + color='#999900', + x=width / 2, + y=height / 2) + return False + def __new_thought_button_cb(self, button): self._model.create_new_thought() |