第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Kivy 標(biāo)簽文本不更新

Kivy 標(biāo)簽文本不更新

慕姐4208626 2023-08-08 16:46:55
我正在與 Kivy 一起開發(fā)日歷程序。我的問題出在 print_appointment_to_label 函數(shù)中。我在函數(shù)末尾寫了appointment_label.text =appointment_name_file_content,但標(biāo)簽僅在我重新啟動程序時才更新。如果您想知道 label_id_file_content 代表“1jal”,即標(biāo)簽 id。謝謝你的幫助朱利葉斯Python:# diable multitouchfrom kivy.config import ConfigConfig.set('input', 'mouse', 'mouse,multitouch_on_demand')from kivy.app import Appfrom kivy.uix.screenmanager import Screen,ScreenManagerfrom kivy.lang.builder import Builderfrom kivy.uix.popup import Popupfrom kivy.uix.floatlayout import FloatLayoutfrom kivy.clock import Clockclass screenmanager(ScreenManager):    passclass PopupContent(FloatLayout):    def store_appointment_name(self):        appointment_name = self.ids.appointment_name.text        with open("appointment_name_file","w") as appointment_name_file:            appointment_name_file.write(appointment_name)        with open("label_id_file","r") as label_id_file:            label_id_file_content = label_id_file.read()        #check month        if "ja" in label_id_file_content:            Ja = JanuaryWindow()            Ja.__init__()class MonthWindow(Screen):    passclass JanuaryWindow(Screen):    def __init__(self, **kwargs):        super(JanuaryWindow, self).__init__(**kwargs)        Clock.schedule_once(self.print_appointment_to_label)    def print_appointment_to_label(self,dt):        with open("appointment_name_file", "r") as appointment_name_file:            appointment_name_file_content = appointment_name_file.read()        with open("label_id_file", "r") as label_id_file:            label_id_file_content = label_id_file.read()        appointment_label = self.ids[label_id_file_content]        appointment_label.text = appointment_name_file_content
查看完整描述

1 回答

?
桃花長相依

TA貢獻(xiàn)1860條經(jīng)驗 獲得超8個贊

您的安排不正確,以下說法: Clock.schedule_once(self.print_appointment_to_label) 應(yīng)該是: Clock.schedule_once(self.print_appointment_to_label, .5)



查看完整回答
反對 回復(fù) 2023-08-08
  • 1 回答
  • 0 關(guān)注
  • 160 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號