0
因此,我正在開發一個kivy項目,並且還在爲它學習語言(我的意思是python),我在這裏有這個小程序。所以在我的第一個屏幕上有一些語言按鈕,但我也有文字在第二頁中更改。我怎樣才能在課堂上調用其他課程的功能,或者我應該用不同的方式來改變課本?任何TIPP將是有益的:)謝謝Kivy在其他屏幕上調用函數
class ScreenOne(Screen):
def d_language(self):
self.hellolabel.text='Hallo'
def fr_language(self):
self.hellolabel.text='Bonjour'
class ScreenTwo(Screen):
def d_languagetwo(self):
self.otherlabel.text='Zweite seite'
def fr_languagetwo(self):
self.otherlabel.text='Deuxième page'
喜利,看看[這] (https://stackoverflow.com/questions/45024151/calling-function-in-a-different-class-through-kivy-button/45025220#45025220)和[this](https://stackoverflow.com/questions/ 7965114 /主叫一個功能 - 從類合蟒-不同路)。另外,你的Button在哪裏?如果可能的話,添加更多代碼項目 – favcau
感謝tipps :) Yoav Glazner的回答是我一直在尋找的主要內容 – Levi