From 6e43d6f6a223e17eaacfa142d6cdae1fe979c45e Mon Sep 17 00:00:00 2001 From: Joe Shochet Date: Fri, 27 Jul 2001 22:52:45 +0000 Subject: [PATCH] *** empty log message *** --- direct/src/gui/DirectScrolledList.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/direct/src/gui/DirectScrolledList.py b/direct/src/gui/DirectScrolledList.py index 69d2626559..f8800b51a5 100644 --- a/direct/src/gui/DirectScrolledList.py +++ b/direct/src/gui/DirectScrolledList.py @@ -72,6 +72,16 @@ class DirectScrolledList(DirectFrame): def scrollTo(self, index): self.index = index + + # Not enough items to even worry about scrolling, + # just disable the buttons and do nothing + if (len(self["items"]) <= self["numItemsVisible"]): + self.incButton['state'] = DISABLED + self.decButton['state'] = DISABLED + # Hmm.. just reset self.index to 0 I guess + self.index = 0 + return + if (self.index <= 0): self.index = 0 self.decButton['state'] = DISABLED