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

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

      <legend id='Ipgqk'><style id='Ipgqk'><dir id='Ipgqk'><q id='Ipgqk'></q></dir></style></legend>

        • <bdo id='Ipgqk'></bdo><ul id='Ipgqk'></ul>
      1. 用kivy按下按鈕時如何更改空格?

        How to change a space when a button is pressed with kivy?(用kivy按下按鈕時如何更改空格?)

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

                <legend id='pkimr'><style id='pkimr'><dir id='pkimr'><q id='pkimr'></q></dir></style></legend>

                  <tbody id='pkimr'></tbody>

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

                  本文介紹了用kivy按下按鈕時如何更改空格?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在嘗試通過實現

                  問:如何配置 drawingspace.kv 以使每個按下的按鈕具有不同的布局和不同的小部件?

                  解決方案

                  一個巧妙的方法是使用屏幕.

                  由于我已經從您之前的問題中獲得了此應用程序的示例,因此很容易實現屏幕,并稍微重寫類.

                  當按下按鈕時,您將屏幕管理器的當前設置為您想要的屏幕名稱.

                  然后您只需在每個屏幕、kv 文件或 python 文件中根據需要編輯布局.

                  我選擇在這里用 kv 語言制作大部分布局內容.因為我發現以我想要的方式開發布局更容易.以后如果我愿意,我可以將它重寫為 python.

                  所以我的 python 文件現在看起來像這樣:

                  從 kivy.app 導入 App從 kivy.uix.boxlayout 導入 BoxLayout從 kivy.properties 導入 StringProperty從 kivy.clock 導入時鐘從 kivy.uix.screenmanager 導入 Screen,ScreenManager,NoTransition從 kivy.lang 導入生成器進口時間builder.load_file("kv.kv")類 MyLayout(BoxLayout):def __init__(self,**kwargs):super(MyLayout,self).__init__(**kwargs)self.orientation = "垂直"self.padding = 10類 MainScreen(屏幕):經過類刪除屏幕(屏幕):經過類 GroupScreen(屏幕):經過MyLogo 類(BoxLayout):your_time = StringProperty()def __init__(self,**kwargs):super(MyLogo,self).__init__(**kwargs)Clock.schedule_interval(self.set_time, 0.1)def set_time(self,dt):self.your_time = time.strftime("%m/%d/%Y %H:%M")我的應用程序(應用程序)類:def __init__(self,**kwargs):super(MyApp,self).__init__(**kwargs)self.sm = ScreenManager(transition=NoTransition())self.sm.add_widget(MainScreen(name = "main"))self.sm.add_widget(RemoveScreen(name = "remove"))self.sm.add_widget(GroupScreen(name = "group"))self.sm.current = "主要"定義構建(自我):返回自我.sm如果 __name__ == "__main__":MyApp().run()

                  而 kv.kv 文件看起來像這樣:

                  #:kivy 1.9.1<MyButtons@BoxLayout>:填充:10,10,10,0間距:10大小提示:1,0.3方向:水平"按鈕:文字:清除"on_press: app.sm.current = "main"按鈕:文字:刪除"on_press: app.sm.current = "刪除"按鈕:文字:組"on_press: app.sm.current = "組"按鈕:文字:顏色"按鈕:文字:手勢"<我的標志>:間距:10填充:10,10,10,0方向:水平"盒子布局:方向:垂直"大小提示:0.3,1帆布:長方形:pos: self.pos尺寸:self.size異步圖像來源:'http://lmsotfy.com/so.png'標簽:大小提示:1,0.3文本:root.your_time顏色:[0,0,0,1]標簽:大小提示:1,0.3文本:紐約市,紐約,美國"顏色:[0,0,0,1]<主屏幕>:我的布局:我的標志:#按鈕:# 文本:主要"我的按鈕:#紐扣盒子布局:填充:10,10,10,10大小提示:1,0.3按鈕:文本:總數:1 Kivy Started"<刪除屏幕>:我的布局:我的標志:盒子布局:方向:水平"標簽:字體大小:40sp"文字:刪除"按鈕:字體大小:20sp"文字:刪除這個或其他東西"我的按鈕:#紐扣盒子布局:填充:10,10,10,10大小提示:1,0.3按鈕:文本:總數:1 Kivy Started"<組畫面>:我的布局:我的標志:盒子布局:方向:垂直"標簽:字體大小:40sp"文字:組"按鈕:字體大小:20sp"文本:某些東西分組"我的按鈕:#紐扣盒子布局:填充:10,10,10,10大小提示:1,0.3按鈕:文本:總數:1 Kivy Started"

                  I am trying create a GUI by implementing the template of the ComicCreator GUI sample as a template for my own project. The code is easy to follow, but I would like to be able to reconfigure the drawingspace.kv, each time a button is pushed, say for example something like this:

                  Q: How could I configure the drawingspace.kv to have a different layout with different widgets for each button that is pressed?

                  解決方案

                  A neat way to do this is to use screen.

                  Since I allready have an example of this app from you earlier question, it was easy to implement the screens, and rewrite the classes a bit.

                  When a button is pressed, you set the screenmanager's current to whatever the name you named the screen you want.

                  Then you just edit the layouts as you want inside of each screen, in the kv file, or python file.

                  I choose to make most of the layout stuff in kv language here. Because I find it easier to develop a layout the way I want it this way. Later I could rewrite it to python if I want that.

                  So my python file looks like this now:

                  from kivy.app import App
                  from kivy.uix.boxlayout import BoxLayout
                  from kivy.properties import StringProperty
                  from kivy.clock import Clock
                  from kivy.uix.screenmanager import Screen,ScreenManager,NoTransition
                  from kivy.lang import Builder
                  import time
                  
                  
                  Builder.load_file("kv.kv")
                  
                  
                  class MyLayout(BoxLayout):
                  
                      def __init__(self,**kwargs):
                          super(MyLayout,self).__init__(**kwargs)
                          self.orientation = "vertical"
                          self.padding = 10
                  
                  
                  class MainScreen(Screen):
                      pass
                  
                  
                  class RemoveScreen(Screen):
                      pass
                  
                  
                  class GroupScreen(Screen):
                      pass
                  
                  
                  class MyLogo(BoxLayout):
                  
                      your_time = StringProperty()
                      def __init__(self,**kwargs):
                          super(MyLogo,self).__init__(**kwargs)
                          Clock.schedule_interval(self.set_time, 0.1)
                  
                      def set_time(self,dt):
                          self.your_time = time.strftime("%m/%d/%Y %H:%M")
                  
                  
                  
                  
                  class MyApp(App):
                      def __init__(self,**kwargs):
                          super(MyApp,self).__init__(**kwargs)
                          self.sm = ScreenManager(transition=NoTransition())
                  
                          self.sm.add_widget(MainScreen(name = "main"))
                          self.sm.add_widget(RemoveScreen(name = "remove"))
                          self.sm.add_widget(GroupScreen(name = "group"))
                  
                          self.sm.current = "main"
                  
                      def build(self):
                          return self.sm
                  
                  
                  if __name__ == "__main__":
                      MyApp().run()
                  

                  And kv.kv file looks like this:

                  #:kivy 1.9.1
                  
                  <MyButtons@BoxLayout>:
                      padding: 10,10,10,0
                      spacing: 10
                      size_hint: 1,0.3
                      orientation: "horizontal"
                      Button:
                          text: "Clear"
                          on_press: app.sm.current = "main"
                      Button:
                          text: "Remove"
                          on_press: app.sm.current = "remove"
                      Button:
                          text: "Group"
                          on_press: app.sm.current = "group"
                      Button:
                          text: "Color"
                      Button:
                          text: "Gestures"
                  
                  <MyLogo>:
                      spacing: 10
                      padding: 10,10,10,0
                      orientation: "horizontal"
                      BoxLayout:
                          orientation: "vertical"
                          size_hint: 0.3,1
                          canvas:
                              Rectangle:
                                  pos: self.pos
                                  size: self.size
                          AsyncImage
                              source: 'http://lmsotfy.com/so.png'
                          Label:
                              size_hint: 1,0.3
                              text: root.your_time
                              color: [0,0,0,1]
                          Label:
                              size_hint: 1,0.3
                              text: "NYC, New York, USA"
                              color: [0,0,0,1]
                  
                  
                  <MainScreen>:
                      MyLayout:
                          MyLogo:
                              #Button:
                              #    text: "main"
                  
                          MyButtons:
                              #buttons
                  
                          BoxLayout:
                              padding: 10,10,10,10
                              size_hint: 1,0.3
                              Button:
                                  text: "Total figures: 1          Kivy Started"
                  
                  
                  <RemoveScreen>:
                      MyLayout:
                          MyLogo:
                              BoxLayout:
                                  orientation: "horizontal"
                                  Label:
                                      font_size: "40sp"
                                      text: "Remove"
                                  Button:
                                      font_size: "20sp"
                                      text: "Remove this or something"
                  
                          MyButtons:
                              #buttons
                  
                          BoxLayout:
                              padding: 10,10,10,10
                              size_hint: 1,0.3
                              Button:
                                  text: "Total figures: 1          Kivy Started"
                  
                  
                  <GroupScreen>:
                      MyLayout:
                          MyLogo:
                              BoxLayout:
                                  orientation: "vertical"
                                  Label:
                                      font_size: "40sp"
                                      text: "Group"
                                  Button:
                                      font_size: "20sp"
                                      text: "Something groups stuff"
                  
                          MyButtons:
                              #buttons
                  
                          BoxLayout:
                              padding: 10,10,10,10
                              size_hint: 1,0.3
                              Button:
                                  text: "Total figures: 1          Kivy Started"
                  

                  這篇關于用kivy按下按鈕時如何更改空格?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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 - 自動更改角色顏色)
                    <tbody id='Bba6m'></tbody>
                1. <legend id='Bba6m'><style id='Bba6m'><dir id='Bba6m'><q id='Bba6m'></q></dir></style></legend>
                  <i id='Bba6m'><tr id='Bba6m'><dt id='Bba6m'><q id='Bba6m'><span id='Bba6m'><b id='Bba6m'><form id='Bba6m'><ins id='Bba6m'></ins><ul id='Bba6m'></ul><sub id='Bba6m'></sub></form><legend id='Bba6m'></legend><bdo id='Bba6m'><pre id='Bba6m'><center id='Bba6m'></center></pre></bdo></b><th id='Bba6m'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='Bba6m'><tfoot id='Bba6m'></tfoot><dl id='Bba6m'><fieldset id='Bba6m'></fieldset></dl></div>
                      <bdo id='Bba6m'></bdo><ul id='Bba6m'></ul>

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

                            <tfoot id='Bba6m'></tfoot>
                            主站蜘蛛池模板: 91久久精品一区二区三区 | 亚洲一区视频在线 | 亚洲国产精品视频 | 欧美黄色大片在线观看 | 亚洲欧美精品在线 | 97超碰免费 | 日本视频在线 | 亚洲欧美成人影院 | 日韩精品一区二区三区视频播放 | 国产高清91 | av免费网站在线 | 天天天插| 久久久久久成人 | 欧美视频第三页 | 国产精品美女久久久久aⅴ国产馆 | 中文字幕日韩欧美 | 亚洲成在线观看 | 久久日韩精品 | 亚洲成人中文字幕 | 丁香久久| 中文字幕一区二区三区乱码在线 | 欧美日韩久久久 | 午夜免费视频 | 免费在线日韩 | 一区二区三区高清不卡 | 成人在线视频观看 | 国产精品五月天 | 欧一区 | 超碰精品在线 | 国产在线一区二区 | 久久精品中文 | 国产亚洲欧美日韩精品一区二区三区 | 97在线超碰 | 午夜av电影 | 中文日本在线 | 久久久久久久国产 | 精品一区二区三区电影 | 久久国产亚洲 | 国产极品91| 亚洲精品电影 | 亚洲国产精品一区二区久久 |