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

        <small id='3lJ8K'></small><noframes id='3lJ8K'>

        Kivy CheckBox 看起来像实心黑框(不是复选框)

        Kivy CheckBox Looks Like Solid Black Box (Not a Checkbox)(Kivy CheckBox 看起来像实心黑框(不是复选框))
          <bdo id='sPoHN'></bdo><ul id='sPoHN'></ul>
                <tbody id='sPoHN'></tbody>

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

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

                2. 本文介绍了Kivy CheckBox 看起来像实心黑框(不是复选框)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在制作一个 BoxLayout 小部件(orientation = 'horizontal'),其中包含三个小部件、一个标签、一个文本框和一个复选框.

                  I am making a BoxLayout widget (orientation = 'horizontal') that contains three widgets inside of it, a label, a text box, and a check box.

                  thisRow = BoxLayout(orientation='horizontal')
                  l = Label(text='Enter plate 1:
                  (Plate #)')
                  t = TextInput(text = 'this is a text box')
                  c = CheckBox()
                  thisRow.add_widget(l)
                  thisRow.add_widget(t)
                  thisRow.add_widget(c)
                  

                  这会产生以下小部件 (thisRow):

                  This produces the following widget (thisRow):

                  勾选后...

                  最右边的黑框实际上是复选框,并且可以正常工作,但是用户无法知道它实际上是一个复选框.我希望中间有一个较小的空方块,如图 这里的图片所示.

                  The rightmost black box is actually the checkbox, and works functionally, however there is no way for the user to know that it is in fact a checkbox. I would expect a smaller empty square in the middle, as is depicted in pictures here.

                  如何获得传统的复选框图像(较小的空方框)?或者一般来说,我怎样才能更明显地表明该框是一个复选框,而不仅仅是一个空标签?

                  How do i get the traditional checkbox image (smaller empty square box)? Or generally, how can I make it more obvious that the box is a check box and not just an empty label?

                  谢谢

                  推荐答案

                  这是一个非常有趣的问题,Malonge 很好地尝试了它.现在(1.9.2-dev) CheckBox 的井上仍然有固定的大小,称之为背景.它是 Widget 从 atlas 中获取的图像,并在状态更改时更改.因此,直到 现在 之前,还没有明确的方法可以做到这一点.这是一个例子.很快在 master 上会有 CheckBox(color=[r,g,b,a]) 选项.谢谢;)

                  This is really interesting question and Malonge tried it in a good way. Right now(1.9.2-dev) there is still fixed size on CheckBox's well, call it a background. It's an image that Widget takes from atlas and changes if the state changes. Therefore until now there was no clear way how to do it. Here is an example. Soon on master there'll be CheckBox(color=[r,g,b,a]) option. Thanks ;)

                  from kivy.lang import Builder
                  from kivy.base import runTouchApp
                  from kivy.uix.boxlayout import BoxLayout
                  Builder.load_string('''
                  <CheckBoxBG>:
                      Label:
                      TextInput:
                      CheckBox:
                          canvas.before:
                              Color:
                                  rgb: 1,0,0
                              Rectangle:
                                  pos:self.center_x-8, self.center_y-8
                                  size:[16,16]
                              Color:
                                  rgb: 0,0,0
                              Rectangle:
                                  pos:self.center_x-7, self.center_y-7
                                  size:[14,14]
                  ''')
                  class CheckBoxBG(BoxLayout):pass
                  runTouchApp(CheckBoxBG())
                  

                  这篇关于Kivy CheckBox 看起来像实心黑框(不是复选框)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Kivy 1.9.0 Windows package KeyError: #39;rthooks#39;(Kivy 1.9.0 Windows 包 KeyError: rthooks)
                  Python Kivy: how to call a function on button click?(Python Kivy:如何在按钮单击时调用函数?)
                  How to disable a widget in Kivy?(如何禁用 Kivy 中的小部件?)
                  Centering an object in Kivy(在 Kivy 中将对象居中)
                  How to downgrade to Python 3.4 from 3.5(如何从 Python 3.5 降级到 Python 3.4)
                  Change button or label text color in kivy(在kivy中更改按钮或标签文本颜色)
                  <tfoot id='mpsks'></tfoot>

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

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

                    • <legend id='mpsks'><style id='mpsks'><dir id='mpsks'><q id='mpsks'></q></dir></style></legend>
                        • <bdo id='mpsks'></bdo><ul id='mpsks'></ul>

                            <tbody id='mpsks'></tbody>