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.ctx.save()
|
||||||
self.moveTo(x, y)
|
self.moveTo(x, y)
|
||||||
if callable(callback):
|
if callable(callback):
|
||||||
callback(number)
|
if number is None:
|
||||||
|
callback()
|
||||||
|
else:
|
||||||
|
callback(number)
|
||||||
elif hasattr(callback, '__getitem__'):
|
elif hasattr(callback, '__getitem__'):
|
||||||
try:
|
try:
|
||||||
callback = callback[number]
|
callback = callback[number]
|
||||||
|
|
Loading…
Reference in New Issue