+ def make_callback(f):
+ # This is rather complicated, but loops don't have their own
+ # scope, so putting do_callback inside the loop would not
+ # capture the value of function, but only a reference to the
+ # loop variable (always evaluating to the final value...)
+ def do_callback():
+ f()
+ self.update()
+ return do_callback