<i id='FULuS'><tr id='FULuS'><dt id='FULuS'><q id='FULuS'><span id='FULuS'><b id='FULuS'><form id='FULuS'><ins id='FULuS'></ins><ul id='FULuS'></ul><sub id='FULuS'></sub></form><legend id='FULuS'></legend><bdo id='FULuS'><pre id='FULuS'><center id='FULuS'></center></pre></bdo></b><th id='FULuS'></th></span></q></dt></tr></i><div id='FULuS'><tfoot id='FULuS'></tfoot><dl id='FULuS'><fieldset id='FULuS'></fieldset></dl></div>

        <bdo id='FULuS'></bdo><ul id='FULuS'></ul>

        <tfoot id='FULuS'></tfoot>
      1. <legend id='FULuS'><style id='FULuS'><dir id='FULuS'><q id='FULuS'></q></dir></style></legend>
      2. <small id='FULuS'></small><noframes id='FULuS'>

        加载表单后如何运行函数 Kivy

        时间:2023-10-08

          <small id='Iv38h'></small><noframes id='Iv38h'>

          <i id='Iv38h'><tr id='Iv38h'><dt id='Iv38h'><q id='Iv38h'><span id='Iv38h'><b id='Iv38h'><form id='Iv38h'><ins id='Iv38h'></ins><ul id='Iv38h'></ul><sub id='Iv38h'></sub></form><legend id='Iv38h'></legend><bdo id='Iv38h'><pre id='Iv38h'><center id='Iv38h'></center></pre></bdo></b><th id='Iv38h'></th></span></q></dt></tr></i><div id='Iv38h'><tfoot id='Iv38h'></tfoot><dl id='Iv38h'><fieldset id='Iv38h'></fieldset></dl></div>

          <tfoot id='Iv38h'></tfoot>

            <legend id='Iv38h'><style id='Iv38h'><dir id='Iv38h'><q id='Iv38h'></q></dir></style></legend>
              <tbody id='Iv38h'></tbody>
              • <bdo id='Iv38h'></bdo><ul id='Iv38h'></ul>
                  本文介绍了加载表单后如何运行函数 Kivy的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在 python 中有一个 kivy 程序,它有一个文本框和几个按钮.我已经用 kivy 语言编写了 ui,我需要运行一个更新文本框并等待用户按下按钮的函数.当所有小部件都已加载时,是否有我可以使用的 on_load 属性或某种东西来运行此功能..kv 文件:

                  I have a kivy program in python which has a textbox and a few buttons. I have written the ui in kivy language and I need to run a function which updates the text box and waits for the user to press a button. Is there an on_load property I can use or some sort of thing to run this function when all the widgets have been loaded. The .kv file:

                  <MainGui>:
                     id: layout1
                     orientation: 'horizontal'
                     #I would like for some sort of event like below to run my function:
                     on_load: root.myfunction()
                  

                  推荐答案

                  from kivy.app           import App
                  from kivy.uix.boxlayout import BoxLayout
                  from kivy.uix.label     import Label
                  
                  class DemoApp(App):
                  
                      def build(self):
                          self.layout = layout = BoxLayout()
                          layout.label = Label(text="INITIAL TEXT")
                          layout.add_widget(layout.label)
                          return(self.layout)
                  
                      def on_start(self, **kwargs):
                          self.layout.label.text = "APP LOADED"
                  
                  DemoApp().run()
                  

                  这篇关于加载表单后如何运行函数 Kivy的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:在更改时显示 kivy 滑块值 下一篇:将文本渲染到 kivy 画布

                  相关文章

                  最新文章

                    <bdo id='5LVGN'></bdo><ul id='5LVGN'></ul>
                • <small id='5LVGN'></small><noframes id='5LVGN'>

                    1. <i id='5LVGN'><tr id='5LVGN'><dt id='5LVGN'><q id='5LVGN'><span id='5LVGN'><b id='5LVGN'><form id='5LVGN'><ins id='5LVGN'></ins><ul id='5LVGN'></ul><sub id='5LVGN'></sub></form><legend id='5LVGN'></legend><bdo id='5LVGN'><pre id='5LVGN'><center id='5LVGN'></center></pre></bdo></b><th id='5LVGN'></th></span></q></dt></tr></i><div id='5LVGN'><tfoot id='5LVGN'></tfoot><dl id='5LVGN'><fieldset id='5LVGN'></fieldset></dl></div>
                      <tfoot id='5LVGN'></tfoot>
                    2. <legend id='5LVGN'><style id='5LVGN'><dir id='5LVGN'><q id='5LVGN'></q></dir></style></legend>