Hello,
I am stuck at the following point and wondering if someone could shed some light:
def tableview_cell_for_row(self, tableview, section, row):
person = self.items[row][0]
act = self.items[row][1]
cell = ui.TableViewCell('subtitle')
cell.text_label.text = person.name
cell.detail_text_label.text = act.name
cell.text_label.font = ('Courier', 16)
cell.detail_text_label.font = ('Courier', 11)
cell.selectable = False
g= Gestures()
def popup(data):
console.hud_alert("this is a test")
data.view.background_color = 'gray'
g.add_tap(cell, popup, numbers_of_taps_required = 2, number_of_touches_required = None)
return cell
When I generate the cell for this tableview, I assign it a function upon double tapping the cell using the Gestures module. This all works well, the popup shows up properly.
I have disabled the "cell.selectable" because I do not want the cell to be selected with a single tap. Instead I would like the cell to give visual feedback of being selected upon double tapping, so I change the color to gray in the popup(data) function. And this works as expected as well. However I would like to get the cell's background colour to revert to white after 2 seconds. How do I go about that? I tried the time.sleep() function but that does not work. I tried threading Timer but again no success.
Any idea would be appreciated