# HG changeset patch # User Thinker K.F. Li # Date 1303640256 -28800 # Node ID 8c6078c17f2da658139f67e15d1f48ee2d39c545 # Parent 697ebfa9dc47375e504cb4ce61f216b3f1c8b484 Install test data when show FSM_window diff -r 697ebfa9dc47 -r 8c6078c17f2d pyink/FSM_window.py --- a/pyink/FSM_window.py Sun Apr 24 17:59:11 2011 +0800 +++ b/pyink/FSM_window.py Sun Apr 24 18:17:36 2011 +0800 @@ -293,6 +293,7 @@ def _clear_view(self): root = self._root() + root.setAttribute('inkscape:groupmode', 'layer') children = [child for child in root.childList() if child.name() == 'svg:g'] @@ -338,6 +339,9 @@ pass def on_add_state_toggled(self, *args): + pass + + def _install_test_data(self): domview = self._domview view = self._view_widget.view @@ -354,7 +358,6 @@ print root_node.name() print root_node.childList()[-1].name() - root_node.setAttribute('inkscape:groupmode', 'layer') root_node.appendChild(line_node) def show_msg(*args, **kws): @@ -378,8 +381,6 @@ 240, 180, 260, 180, 300, 130)) - self._update_view() - state = FSM_state('test1') state.init(rdoc, domview) state._draw_state_real(root_node, 'test1', 40, 100, 50) @@ -391,6 +392,13 @@ 160, 120, 200, 100)) pass + + def show(self): + self._install_test_data() + self._install_test_data = lambda: None + self._update_view() + super(FSM_window, self).show() + pass pass if __name__ == '__main__':