本文整理匯總了Python中kivy.uix.carousel.Carousel.load_slide方法的典型用法代碼示例。如果您正苦於以下問題:Python Carousel.load_slide方法的具體用法?Python Carousel.load_slide怎麽用?Python Carousel.load_slide使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類kivy.uix.carousel.Carousel
的用法示例。
在下文中一共展示了Carousel.load_slide方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: MainScreen
# 需要導入模塊: from kivy.uix.carousel import Carousel [as 別名]
# 或者: from kivy.uix.carousel.Carousel import load_slide [as 別名]
class MainScreen(BoxLayout):
def __init__(self, **kwargs):
super(MainScreen, self).__init__(**kwargs)
self.orientation = 'vertical'
title = TitleBar()
self.carousel = Carousel(direction='right', loop=False)
self.spacing=10
dico = Dictionary()
self.carousel.add_widget(dico)
self.m = MainMenu()
self.m.convert_button.bind(on_release=self.convert)
self.m.dictionary_button.bind(on_release=self.dictionary)
self.carousel.add_widget(self.m)
self.carousel.load_slide(self.m)
self.textEntry = TextEntry()
self.textEntry.paragraph_button.bind(on_press=self.convert_paragraph)
self.carousel.add_widget(self.textEntry)
self.result = ResultEntry()
self.result.back.bind(on_press=self.back)
self.carousel.add_widget(self.result)
self.add_widget(title)
self.add_widget(self.carousel)
def convert(self, object):
self.carousel.load_next()
def dictionary(self, object):
self.carousel.load_previous()
def back(self, object):
self.carousel.load_slide(self.m)
def convert_paragraph(self, object):
old_text = self.textEntry.paragraph.text
new_text = politically_correct.polit_changer(old_text)
self.result.paragraph.text = new_text
self.carousel.load_next()