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:
John Baldwin 2014-09-30 17:19:07 +00:00
parent a6aedc5d49
commit c3db6aa680

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)