Support single callback that do not get any number
This commit is contained in:
parent
4dd61691d2
commit
a2a2695c03
|
@ -391,7 +391,10 @@ class Boxes:
|
|||
self.ctx.save()
|
||||
self.moveTo(x, y)
|
||||
if callable(callback):
|
||||
callback(number)
|
||||
if number is None:
|
||||
callback()
|
||||
else:
|
||||
callback(number)
|
||||
elif hasattr(callback, '__getitem__'):
|
||||
try:
|
||||
callback = callback[number]
|
||||
|
|
Loading…
Reference in New Issue