<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ### 1.6事件 Kivy基本上是[基于事件](http://en.wikipedia.org/wiki/Event-driven_programming)驅動的,這也就意味著程序執行順序被事件所決定。 1. 時鐘事件 [時鐘對象](https://kivy.org/docs/api-kivy.clock.html)允許你使用[schedule_once()](https://kivy.org/docs/api-kivy.clock.html#kivy.clock.ClockBase.schedule_once)來定時執行一個函數;或者使用[schedule_interval()](https://kivy.org/docs/api-kivy.clock.html#kivy.clock.ClockBase.schedule_interval)重復執行一個函數。 你也可以利用[create_trigger()](https://kivy.org/docs/api-kivy.clock.html#kivy.clock.ClockBase.create_trigger)創建一個觸發事件,觸發器只能被一個框架調用一次,即使你為該回調函數設置了多次觸發。 2. 輸入事件 所有的鼠標點擊、觸摸、滾輪滾動事件都是[MotionEvent](https://kivy.org/docs/api-kivy.input.motionevent.html#kivy.input.motionevent.MotionEvent)事件的一部分;輸入事件擴展自[輸入處理](https://kivy.org/docs/api-kivy.input.postproc.html),當在**窗口**類執行on_motion事件時被發送。在[部件](https://kivy.org/docs/api-kivy.uix.widget.html#kivy.uix.widget.Widget)中這些事件生成為[on_touch_down()](https://kivy.org/docs/api-kivy.uix.widget.html#kivy.uix.widget.Widget.on_touch_down),[on_touch_move()](https://kivy.org/docs/api-kivy.uix.widget.html#kivy.uix.widget.Widget.on_touch_move)和[on_touch_up()](https://kivy.org/docs/api-kivy.uix.widget.html#kivy.uix.widget.Widget.on_touch_up)事件。 要進一步了解,請參閱[輸入管理](https://kivy.org/docs/api-kivy.input.html) 3. 類事件 在[部件](https://kivy.org/docs/api-kivy.uix.widget.html#kivy.uix.widget.Widget)里,我們的事件分發類[EventDispatcher](https://kivy.org/docs/api-kivy.event.html#kivy.event.EventDispatcher)被用來有效的管理屬性值的變動,這意味著當一個部件改變了它的位置、尺寸,相應的事件就會自動的發送。 并且,正如在按鈕部件中,*on_press*和*on_release*等事件所展示的那樣,你可以利用[register_event_type](https://kivy.org/docs/api-kivy.event.html#kivy.event.EventDispatcher.register_event_type)創建自定義事件, 另外你需要注意的是,如果你重載了一個事件,那么你就必須處理它在基類中定義的所有行為。一個最容易的方式是調用*super()*: ```Python def on_touch_down(self, touch): if super(OurClassName, self).on_touch_down(touch): return True if not self.collide_point(touch.x, touch.y): return False print('you touched me!') return True ``` 如果想對事件有更深入的了解,請參閱[事件和屬性](https://kivy.org/docs/guide/events.html)文檔 ### 下節預告:1.7 非部件類
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看