久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

        <bdo id='5Mxob'></bdo><ul id='5Mxob'></ul>

    1. <tfoot id='5Mxob'></tfoot>

      <small id='5Mxob'></small><noframes id='5Mxob'>

    2. <legend id='5Mxob'><style id='5Mxob'><dir id='5Mxob'><q id='5Mxob'></q></dir></style></legend>
    3. 如何在 Kivy 的畫(huà)布中引用孩子的 id?

      How do I reference id#39;s of children within a canvas in Kivy?(如何在 Kivy 的畫(huà)布中引用孩子的 id?)
      <legend id='6dnEY'><style id='6dnEY'><dir id='6dnEY'><q id='6dnEY'></q></dir></style></legend>

      <small id='6dnEY'></small><noframes id='6dnEY'>

        <tfoot id='6dnEY'></tfoot>

          <i id='6dnEY'><tr id='6dnEY'><dt id='6dnEY'><q id='6dnEY'><span id='6dnEY'><b id='6dnEY'><form id='6dnEY'><ins id='6dnEY'></ins><ul id='6dnEY'></ul><sub id='6dnEY'></sub></form><legend id='6dnEY'></legend><bdo id='6dnEY'><pre id='6dnEY'><center id='6dnEY'></center></pre></bdo></b><th id='6dnEY'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='6dnEY'><tfoot id='6dnEY'></tfoot><dl id='6dnEY'><fieldset id='6dnEY'></fieldset></dl></div>
              <tbody id='6dnEY'></tbody>

              <bdo id='6dnEY'></bdo><ul id='6dnEY'></ul>
              1. 本文介紹了如何在 Kivy 的畫(huà)布中引用孩子的 id?的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                問(wèn)題描述

                當(dāng)我嘗試將 id 分配給畫(huà)布時(shí),我收到錯(cuò)誤 Invalid data after declaration,但我看不到任何其他引用該 id 的方式(例如 e1).如何在我的 Python 代碼中引用 e1?

                I get the error Invalid data after declaration when I try to assign an id to canvas, but I don't see any other way of referencing the id's further below (for example e1). How do I reference e1 in my Python code?

                <MyClockWidget>:
                    face: face
                    ticks: ticks
                    el1: el1
                    FloatLayout:
                        id: face
                        size_hint: None, None
                        pos_hint: {"center_x":0.5, "center_y":0.5}
                        size: 0.9*min(root.size), 0.9*min(root.size)
                        canvas:
                            id: cand
                            Color:
                                rgb: 0.5, 0.5, 0.5
                            Ellipse:
                                size: self.size     
                                pos: self.pos
                        canvas:
                            Color:
                                rgb: 0.1, 0.1, 0.1
                            Ellipse:
                                id: el1
                                size: self.size     
                                pos: self.pos
                                angle_start: 0
                                angle_end: 90
                            Ellipse:
                                id: el2
                                size: self.size     
                                pos: self.pos
                                angle_start: 110
                                angle_end: 130
                

                推薦答案

                我覺(jué)得用不到 instruction groups 有很好的文檔記錄,但這里有一個(gè)示例,說(shuō)明如何使用它們以后訪問(wèn) Canvas 元素.此示例還展示了如何使用屬性來(lái)控制 Canvas 指令的各個(gè)方面:

                I don't think the use of instruction groups in kv lang is well documented, but here is an example for how to use them to later access Canvas elements. This example also show how to use properties to control aspects of a Canvas instruction:

                from kivy.app import App
                from kivy.uix.slider import Slider
                from kivy.lang import Builder
                from kivy.graphics import Color
                
                kv = """
                #:kivy 1.9.1
                BoxLayout:
                    orientation: 'vertical'
                    Widget:
                        id: w_canvas
                        my_color: (0, 1, 1)
                        canvas:
                            Color:
                                rgb: self.my_color
                            Rectangle:
                                pos: self.pos
                                size: (self.width/2, self.height/2)
                            Color:
                                group: 'b'
                                rgb: (0, .8, 0)
                            Ellipse:
                                group: 'a'
                                pos: (self.pos[0], self.pos[1] + self.height/2)
                                size: (self.width/4, self.height/4)
                            Ellipse:
                                group: 'b'
                                pos: (self.pos[0]+ self.width/2, self.pos[1] + self.height/2)
                                size: (self.width/4, self.height/4)
                    Button:
                        text: 'Click me'
                        on_release: app.handle_button()
                """
                class Test(App):
                    def build(self):
                        return Builder.load_string(kv)
                    def handle_button(self):
                        # binding Canvas instruction property to Widget property
                        self.root.ids.w_canvas.my_color = (.5, .2, 0)
                        # Access single item of canvas instruction group
                        an_ellipse = self.root.ids.w_canvas.canvas.get_group('a')[0]
                        an_ellipse.pos = (an_ellipse.pos[0] + 10, an_ellipse.pos[1])
                        # loop through all elements of canvas instruction group
                        for gitem in self.root.ids.w_canvas.canvas.get_group('b'):
                            if isinstance(gitem, Color):
                                gitem.rgb = (0, .5, 1)
                            try:
                                gitem.size = (gitem.size[0] / 2.0, gitem.size[1])
                            except:
                                pass
                
                Test().run()
                

                這篇關(guān)于如何在 Kivy 的畫(huà)布中引用孩子的 id?的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                相關(guān)文檔推薦

                How to make a discord bot that gives roles in Python?(如何制作一個(gè)在 Python 中提供角色的不和諧機(jī)器人?)
                Discord bot isn#39;t responding to commands(Discord 機(jī)器人沒(méi)有響應(yīng)命令)
                Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關(guān)于我嗎?Discord 機(jī)器人的功能?(不和諧.py))
                message.channel.id Discord PY(message.channel.id Discord PY)
                How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機(jī)器人?)
                discord.py - Automaticaly Change an Role Color(discord.py - 自動(dòng)更改角色顏色)
                <legend id='zXxv0'><style id='zXxv0'><dir id='zXxv0'><q id='zXxv0'></q></dir></style></legend>
                  <tbody id='zXxv0'></tbody>

                  <tfoot id='zXxv0'></tfoot>

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

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

                      <i id='zXxv0'><tr id='zXxv0'><dt id='zXxv0'><q id='zXxv0'><span id='zXxv0'><b id='zXxv0'><form id='zXxv0'><ins id='zXxv0'></ins><ul id='zXxv0'></ul><sub id='zXxv0'></sub></form><legend id='zXxv0'></legend><bdo id='zXxv0'><pre id='zXxv0'><center id='zXxv0'></center></pre></bdo></b><th id='zXxv0'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='zXxv0'><tfoot id='zXxv0'></tfoot><dl id='zXxv0'><fieldset id='zXxv0'></fieldset></dl></div>
                          主站蜘蛛池模板: av大片在线| 麻豆一区二区三区 | 精品久久久久久亚洲精品 | 操皮视频 | 激情五月婷婷在线 | 干一干操一操 | 国产a级毛毛片 | 日韩中文字幕av | 免费视频二区 | 6080yy精品一区二区三区 | 亚洲国产精品久久久久久 | 日日摸日日碰夜夜爽2015电影 | 国产综合第一页 | 成人国产精品久久久 | 久久久久久久久久久成人 | 久久久久久久综合 | 精品一区二区不卡 | 日韩一区二区三区视频在线观看 | 国产aⅴ爽av久久久久久久 | 色网在线看 | 国产在线精品一区二区 | 久久精品99 | 国产一级视屏 | 国产精品久久久久久久久久久新郎 | 久久性| 毛片一区二区三区 | 日韩久久久久久 | 色综合久| 最新高清无码专区 | 国产精品一二三区 | 欧美精品一区二区免费视频 | 国产视频二区在线观看 | 人人干在线视频 | 欧美日韩一区二区在线 | 日韩精品一区二区三区中文在线 | 国产激情在线 | 国产欧美精品区一区二区三区 | 国产在线一区二区 | 成人在线视频免费观看 | 欧美精品欧美精品系列 | 91资源在线观看 |