def goto_ok(self, *args):
rows = len(self.data_view)
num = self.goto_textinput.text
if num.isdigit():
if int(num) > 0 and rows >= int(num):
if int(num) >= rows - 12:
self.k = rows
self.dismiss_goto_popup()
self.SetUpGrid(self.data, len(self.data), 'over')
else:
self.k = int(num) - 1
self.dismiss_goto_popup()
if self.k >= rows - 24:
self.SetUpGrid(self.data, len(self.data), '')
else:
self.SetUpGrid(self.data, len(self.data), 'up!')
Clock.unschedule(self.check_scroll_limit)
Clock.schedule_interval(self.check_scroll_limit, 0.11)
else:
self.dismiss_goto_popup()
goto_failed_popup = Popup(
title='Error', content=Label(
text='Please write an integer in the given range'), size_hint=(
0.8, 0.2))
goto_failed_popup.open()
else:
self.dismiss_goto_popup()
goto_failed_popup = Popup(
title='Error', content=Label(
text='Please write an integer in the given range'), size_hint=(
0.8, 0.2))
goto_failed_popup.open()
评论列表
文章目录