0

フロート レイアウト エリアにチェックボックスを作成しようとしています。チェックボックスを生成していますが、クリックするたびに、ボックスになくてもTrueからFalseになります。誰かが洞察を提供できますか?

私のコード:

from kivy.app import App
from kivy.lang import Builder
from kivy.uix.checkbox import CheckBox
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.screenmanager import ScreenManager, Screen, NoTransition
from kivy.uix.textinput import TextInput
from kivy.uix.widget import Widget


#######``Windows``#######
class MainScreen(Screen):
    pass

class AnotherScreen(Screen):
    def add(self, *args):
        a = self.ids["a"].text
        a = int(a)
        self.ids["adds"]
        plus = 1 + a
        print plus

class ScreenManagement(ScreenManager):
    pass


presentation = Builder.load_file("GUI_Style.kv")

class MainApp(App):
    def build(self):
        return presentation

if __name__ == "__main__":
    MainApp().run()

私の KV ファイル:

#: import NoTransition kivy.uix.screenmanager.NoTransition

ScreenManagement:
    transition: NoTransition()
    MainScreen:
    AnotherScreen:

<MainScreen>:
    background_color: 0.5, 1, 0.22, 1
    name: "main"
    FloatLayout:
        Button:
            text: "Quit"
            font_size: 50
            color: 0,1,0,1
            font_size: 25
            size_hint: 0.3,0.2
            pos_hint: {"x":0, "y":0}
            on_release: app.window().stop()
        Button:
            on_release: app.root.current = "other"
            text: "Next Screen"
            font_size: 50
            color: 0,1,0,1
            font_size: 25
            size_hint: 0.3,0.2
            pos_hint: {"right":1, "top":1}

<AnotherScreen>:
    name: "other"
    canvas.before:
        Color:
            rgba: 1, 1, 1, 1
        Rectangle:
            pos: self.pos
            size: self.size
    FloatLayout:
        CheckBox:
            pos_hint: {"x":0.2, "y":0.2}
            on_release: True
        TextInput:
            id: a
            font_size: 25
            password: True
            pos_hint: {"x":0.5, "y":0.5}
            size_hint: 0.3,0.2
            text: "Insert Side A here"
        Button:
            id: adds
            background_color: 0,0,1,1
            color: 0,1,0,1
            font_size: 25
            on_release: root.add()
            pos_hint: {"x":0, "y":0}
            size_hint: 0.3,0.2
            text: "plus"
        Button:
            color: 0,1,0,1
            background_color: 0,0,1,1
            font_size: 25
            size_hint: 0.3,0.2
            text: "Back Home"
            on_release: app.root.current = "main"
            pos_hint: {"right":1, "top":1}
4

1 に答える 1