Mercurial > MadButterfly
comparison pyink/FSM_window.py @ 1489:1e607ce4bf7d
Rename FSM_window._grab_hdl to _grab_mouse_hdl
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Sat, 30 Apr 2011 18:16:44 +0800 |
parents | 757c5626d15d |
children | 3f107ceee9c1 |
comparison
equal
deleted
inserted
replaced
1488:757c5626d15d | 1489:1e607ce4bf7d |
---|---|
700 _fsm_layer = None | 700 _fsm_layer = None |
701 _control_layer = None | 701 _control_layer = None |
702 width = 1024 | 702 width = 1024 |
703 height = 768 | 703 height = 768 |
704 | 704 |
705 _grab_hdl = None | 705 _grab_mouse_hdl = None |
706 _bg_hdl = None | 706 _bg_hdl = None |
707 | 707 |
708 _leave_mode_cb = None | 708 _leave_mode_cb = None |
709 _move_state_mode = None | 709 _move_state_mode = None |
710 _add_state_mode = None | 710 _add_state_mode = None |
965 self._add_state_mode.activate() | 965 self._add_state_mode.activate() |
966 super(FSM_window, self).show() | 966 super(FSM_window, self).show() |
967 pass | 967 pass |
968 | 968 |
969 def grab_mouse(self, callback): | 969 def grab_mouse(self, callback): |
970 assert self._grab_hdl is None | 970 assert self._grab_mouse_hdl is None |
971 | 971 |
972 root = self._root() | 972 root = self._root() |
973 root.setAttribute('inkscape:groupmode', '') | 973 root.setAttribute('inkscape:groupmode', '') |
974 self._grab_hdl = root.spitem.connect('mouse-event', callback) | 974 self._grab_mouse_hdl = root.spitem.connect('mouse-event', callback) |
975 pass | 975 pass |
976 | 976 |
977 def ungrab_mouse(self): | 977 def ungrab_mouse(self): |
978 if not self._grab_hdl: | 978 if not self._grab_mouse_hdl: |
979 return | 979 return |
980 | 980 |
981 root = self._root() | 981 root = self._root() |
982 root.spitem.disconnect(self._grab_hdl) | 982 root.spitem.disconnect(self._grab_mouse_hdl) |
983 self._grab_hdl = None | 983 self._grab_mouse_hdl = None |
984 root.setAttribute('inkscape:groupmode', 'layer') | 984 root.setAttribute('inkscape:groupmode', 'layer') |
985 pass | 985 pass |
986 | 986 |
987 def grab_bg(self, callback): | 987 def grab_bg(self, callback): |
988 assert self._bg_hdl is None | 988 assert self._bg_hdl is None |