예제 #1
0
 def edXY_on_key_enter(self, event):
     #print(event)
     if event.keycode == 13:
         # "Enter" key pressed
         try:
             x = int(self.ed_x.get())
             y = int(self.ed_y.get())
         except Exception as e:
             showerror(message='invalid symbols in edit fields for X and Y')
             return
         #self.raise_action('MOVE_TO', x, y, self.on_move_done)
         dispatcher.trigger_event('go_coordinates', x, y, self.on_move_done)
예제 #2
0
    def step(self):
        if self._steps_to_move == 0:
            #print('id={} no steps to move'.format(self._id))
            pass
        else:
            # make one step in direction (-1 or +1)
            self._steps_to_move -= 1
            #if self._on_step:
            #    self._on_step(self._id, self._rads_per_step * self._dir_to_move)
            dispatcher.trigger_event('step', self._id,
                                     self._rads_per_step * self._dir_to_move)
            #print('id={}, s2m={}'.format(self._id, self._steps_to_move))

        return self._steps_to_move
예제 #3
0
 def on_click(self, event):
     print(event)
     dispatcher.trigger_event('on_click', x=event.x, y=event.y)