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

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

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

      <tfoot id='rTkDr'></tfoot>

        <bdo id='rTkDr'></bdo><ul id='rTkDr'></ul>
      1. <legend id='rTkDr'><style id='rTkDr'><dir id='rTkDr'><q id='rTkDr'></q></dir></style></legend>
      2. 在 python 端的 kivy 中分配 id

        asigning ids in kivy on the python side(在 python 端的 kivy 中分配 id)
        <tfoot id='mJxc3'></tfoot>

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

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

        • <legend id='mJxc3'><style id='mJxc3'><dir id='mJxc3'><q id='mJxc3'></q></dir></style></legend>
            <tbody id='mJxc3'></tbody>

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

                  本文介紹了在 python 端的 kivy 中分配 id的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 kivy.我想做的是擁有和想法",一個滑塊和一個標簽,該標簽在網格布局中的一行中包含滑塊的當前值

                  im using kivy. the what im trying to do is have and 'idea',a slider and a label containing the slider's current value in a row in a grid layout

                  現在獲得布局很好,但讓標簽具有與滑塊當前值相同的文本值是棘手的.我正在嘗試使用字符串連接來引用與它配對的滑塊具有相同數字后綴的標簽.

                  now getting the layout is fine but getting the label to have a text value the same as the slider's current value is tricky. I'm trying to use string concation to refer to the label with the same number suffix as the slider that it is paired with.

                  我認為我遇到的問題是,當通常必須在 kv 端完成時,我試圖在 python 端分配 id.當 kv 通常期望純文本時,要么就是我分配的 id 是字符串,要么是事實.任何幫助將不勝感激

                  I think the problem im having is that im trying to assign ids on the python side when they normally have to be done on the kv side. It's either that or the fact the ids i'm assigning are strings when kv would normally expect plain text. any help would be appreciated

                  class ScatterTextWidget(FloatLayout):
                          def run_me(self):
                              r=1 
                              main_list=self.ids.main_list
                              main_list.clear_widgets()
                              main_list.height=0
                              for idea in imported_ideas:     
                                  main_list.add_widget(Label(text=idea,color=(0,0,0,1),id='idea_label_'+str(r)))
                                  main_list.add_widget(Slider(id='Slider_'+str(r),min=0,max=10,value=5, step=1,on_value_pos=self.slider_slid(self)))
                                  main_list.add_widget(Label(color=(0,0,0,1),id='value_label_'+str(r)))
                  
                                  value_label=self.ids['value_label_'+str(r)] # get this working and then apply the method into slider slid
                                  value_label.text='xxx'
                  
                                  main_list.height+=35                
                  
                                  r +=1
                              button_1=self.ids.button_1
                              button_1.text='Begin'
                              button_1.bind(on_press=self.begin)
                  
                          def slider_slid(self,sender):
                  
                              s=str(sender.id)
                  
                              value_label=self.ids['value_label_'+str(s[12:])]
                              value_label.text=str(sender.value)
                  

                  value_label=self.ids['value_label_'+str(s[12:])]KeyError:'value_label_'

                  value_label=self.ids['value_label_'+str(s[12:])] KeyError: 'value_label_'

                  推薦答案

                  self.ids 在widget的kv語言規則中只收集children的id.它不知道您通過 python 添加的小部件.

                  self.ids only collects ids from children in the kv language rule of the widget. It doesn't know about widgets you added via python.

                  不過,您不需要使用 id.在這種情況下,您可以保留例如id -> 小部件鍵的字典.

                  You don't need to use the id though. In this case you could keep e.g. a dictionary of id -> widget keys.

                  self.keys_dict = {}
                  for idea in imported_ideas:     
                      new_widget = Label(color=(0,0,0,1),id='value_label_'+str(r)))
                      main_list.add_widget(new_widget)
                      self.keys_dict['value_label_' + str(r)] = new_widget
                  

                  然后您可以使用 self.keys_dict['value_label_' + str(s[12:])] 或任何您喜歡的方式訪問它.

                  Then later you can access it with self.keys_dict['value_label_' + str(s[12:])] or whatever you like.

                  我想在實踐中您也可以以相同的方式修改實際的 ids 字典,盡管我主觀上認為最好使用代表其更具體內容的名稱來維護您自己的字典.

                  I suppose in practice you could also modify the actual ids dictionary in the same way, though I subjectively feel it is preferable to maintain your own dictionary with a name that represents its more specific contents.

                  這篇關于在 python 端的 kivy 中分配 id的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  How to make a discord bot that gives roles in Python?(如何制作一個在 Python 中提供角色的不和諧機器人?)
                  Discord bot isn#39;t responding to commands(Discord 機器人沒有響應命令)
                  Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“關于我嗎?Discord 機器人的功能?(不和諧.py))
                  message.channel.id Discord PY(message.channel.id Discord PY)
                  How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 機器人?)
                  discord.py - Automaticaly Change an Role Color(discord.py - 自動更改角色顏色)
                  <i id='wIHNO'><tr id='wIHNO'><dt id='wIHNO'><q id='wIHNO'><span id='wIHNO'><b id='wIHNO'><form id='wIHNO'><ins id='wIHNO'></ins><ul id='wIHNO'></ul><sub id='wIHNO'></sub></form><legend id='wIHNO'></legend><bdo id='wIHNO'><pre id='wIHNO'><center id='wIHNO'></center></pre></bdo></b><th id='wIHNO'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='wIHNO'><tfoot id='wIHNO'></tfoot><dl id='wIHNO'><fieldset id='wIHNO'></fieldset></dl></div>

                      <legend id='wIHNO'><style id='wIHNO'><dir id='wIHNO'><q id='wIHNO'></q></dir></style></legend>
                          <tbody id='wIHNO'></tbody>
                        <tfoot id='wIHNO'></tfoot>
                        • <bdo id='wIHNO'></bdo><ul id='wIHNO'></ul>
                        • <small id='wIHNO'></small><noframes id='wIHNO'>

                          1. 主站蜘蛛池模板: 国产精品久久久99 | 日韩精品久久久久 | 日朝毛片 | 精品国产91乱码一区二区三区 | 一级高清免费毛片 | 国产一区二区三区四区 | 日本免费小视频 | 欧美日韩美女 | 91精品国产综合久久久密闭 | 日日摸夜夜爽人人添av | 欧美一级全黄 | 一区二区三区视频在线 | 日韩中文一区 | 日韩一区二区三区四区五区六区 | 男人天堂久久 | 久久国产精品一区二区三区 | 久久夜色精品国产 | 国产精品一码二码三码在线 | 国产一级片av | 国产精品久久久av | 久久一区二区视频 | 九九在线视频 | 国产精品视频 | 国产精品久久久久久久久图文区 | 国产一区二区免费在线 | 九色在线观看 | 我要看黄色录像一级片 | 国产一区二区欧美 | av网站免费观看 | 99一区二区| 粉嫩国产精品一区二区在线观看 | 精品一区二区在线观看 | 中文区中文字幕免费看 | 欧美一区二区三区精品 | 色视频网站免费 | 亚洲精品在线91 | 午夜电影日韩 | 香蕉av免费| 成人免费观看男女羞羞视频 | 日日夜夜免费精品 | 91视频久久 |