comparison pyink/frameline.py @ 969:d4b934d97a62

check range of pointer
author Thinker K.F. Li <thinker@codemud.net>
date Thu, 18 Nov 2010 12:02:21 +0800
parents a715301b5879
children a1ebbe11354d
comparison
equal deleted inserted replaced
968:a715301b5879 969:d4b934d97a62
155 self.emit(frameline.FRAME_BUT_PRESS, frame, but) 155 self.emit(frameline.FRAME_BUT_PRESS, frame, but)
156 pass 156 pass
157 157
158 def _motion_hdl(self, widget, event): 158 def _motion_hdl(self, widget, event):
159 frame = int(event.x / self._frame_width) 159 frame = int(event.x / self._frame_width)
160 self._draw_hover(frame) 160 if frame < self._num_frames and frame >= 0:
161 self._draw_hover(frame)
161 pass 162 pass
162 163
163 def _fl_expose(self, widget, event): 164 def _fl_expose(self, widget, event):
164 win = self.window 165 win = self.window
165 x, y, w, h, depth = win.get_geometry() 166 x, y, w, h, depth = win.get_geometry()