• <bdo id='MIeXM'></bdo><ul id='MIeXM'></ul>

  1. <small id='MIeXM'></small><noframes id='MIeXM'>

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

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

      时间:2023-06-06
      <legend id='dVi2A'><style id='dVi2A'><dir id='dVi2A'><q id='dVi2A'></q></dir></style></legend>

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

        <tfoot id='dVi2A'></tfoot>
          <tbody id='dVi2A'></tbody>

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

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

                本文介绍了加载表单后如何运行函数 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文章

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

                2. <small id='vTaUc'></small><noframes id='vTaUc'>