# HG changeset patch # User Thinker K.F. Li # Date 1302963935 -28800 # Node ID 416a18409603d39ca94693cd24381b3afa945266 # Parent 894a4bf35fe6efd438d521db11b399130050a4c9 Show an empty document in SVG viewer widget diff -r 894a4bf35fe6 -r 416a18409603 pyink/FSM_window.glade --- a/pyink/FSM_window.glade Sat Apr 16 19:41:12 2011 +0800 +++ b/pyink/FSM_window.glade Sat Apr 16 22:25:35 2011 +0800 @@ -203,7 +203,7 @@ automatic automatic - + True queue diff -r 894a4bf35fe6 -r 416a18409603 pyink/FSM_window.py --- a/pyink/FSM_window.py Sat Apr 16 19:41:12 2011 +0800 +++ b/pyink/FSM_window.py Sat Apr 16 22:25:35 2011 +0800 @@ -61,8 +61,8 @@ def __init__(self, close_cb, destroy_cb): super(FSM_window, self).__init__() - self._close_cb = close_cb - self._destroy_cb = destroy_cb + self._close_cb = close_cb # callback to close editor window (hide) + self._destroy_cb = destroy_cb # callback to destroy editor window pass def set_svg_view(self, view): diff -r 894a4bf35fe6 -r 416a18409603 pyink/comp_dock.py --- a/pyink/comp_dock.py Sat Apr 16 19:41:12 2011 +0800 +++ b/pyink/comp_dock.py Sat Apr 16 22:25:35 2011 +0800 @@ -277,17 +277,33 @@ domview_ui.switch_timeline(timeline_name) pass + def _prepare_FSM_editor(self): + def FSM_editor_close(): + self._fsm_editor_win.hide() + pass + + def FSM_editor_destroy(): + self._fsm_editor_win = None + pass + + fsm_win = FSM_window.FSM_window(FSM_editor_close, + FSM_editor_destroy) + self._fsm_editor_win = fsm_win + + doc = pybInkscape.createSPDocument() + view_widget = pybInkscape.create_svg_view_widget(doc) + view_widget.show() + + self._FSM_doc = doc + self._FSM_view_widget = view_widget + + fsm_win.set_svg_view(view_widget) + pass + def _show_FSM_editor(self): if not self._fsm_editor_win: - def FSM_editor_close(): - self._fsm_editor_win.hide() - pass - def FSM_editor_destroy(): - self._fsm_editor_win = None - pass - fsm_win = FSM_window.FSM_window(FSM_editor_close, - FSM_editor_destroy) - self._fsm_editor_win = fsm_win + self._prepare_FSM_editor() + fsm_win = self._fsm_editor_win else: fsm_win = self._fsm_editor_win pass