How is it possible with GTK to set a menu item insensitive after clicked, but make it sensitive again, after something about 5 seconds.
If I do something like this, it doesn’t work (I have no idea why not)
self.shutdown_item.connect("activate",self.shutdown)
self.shutdown_item.connect("activate",self.sensitiveshutdown)
def sensitiveshutdown(self,widget):
shutdown_item.set_sensitive(False)
time.sleep(5)
shutdown_item.set_sensitive(True)
doesn’t work. It freezes the gui for 5 seconds but the button stays sensitive.
Is there a way to do this?
So the way about as @unwind pointed out is a time-out (you need to import
gobject: