Explicitly return None for negative event indices. Prior to this,

eventat(-1) would return the next-to-last event causing the back button
to cycle back to the end of an event source instead of stopping at the
start.
This commit is contained in:
jhb 2014-09-30 17:19:07 +00:00
parent 3083772f7f
commit 0410aaa991

View File

@ -856,7 +856,7 @@ def ysize(self):
return (Y_EVENTSOURCE)
def eventat(self, i):
if (i >= len(self.events)):
if (i >= len(self.events) or i < 0):
return (None)
event = self.events[i]
return (event)