~ubicast/candies/2.2-stable

« back to all changes in this revision

Viewing changes to candies2/clicking.py

  • Committer: Stephane Diemer
  • Date: 2010-11-15 19:10:25 UTC
  • Revision ID: stephane.diemer@ubicast.eu-20101115191025-pwjv8xbpe5nx089w
Remove grab pointer from simple click ;

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
    def on_press(self, source, event):
21
21
        self._is_pressed = True
22
 
        clutter.grab_pointer(self.actor)
23
22
        return True
24
23
 
25
24
    def on_release(self, source, event):
26
25
        if self._is_pressed == True:
27
26
            self._is_pressed = False
28
 
            clutter.ungrab_pointer()
29
27
            self.actor.emit('simple-click-event')
30
28
            return True
31
29
        return False
56
54
    def on_press(self, source, event):
57
55
        if self._timeout_id:
58
56
            gobject.source_remove(self._timeout_id)
 
57
        clutter.grab_pointer(self.actor)
59
58
        self._is_long = False
60
 
        SimpleClick.on_press(self, source, event)
 
59
        self._is_pressed = True
61
60
        self._timeout_id = gobject.timeout_add(self.long_delay, self.on_long_press, source)
62
61
        #if self.long_msg is not None:
63
62
        #    self.launchEvent('info', 'Hold %s seconds to %s' %(self.long_delay_ms/1000, self.long_msg))