Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hello,I want ask: What do you mean by a few 'parent' and 'ids' here? #1

Open
tianyi725 opened this issue Aug 10, 2019 · 0 comments
Open

Comments

@tianyi725
Copy link

.kv file
`

<NumberButton@Button>:
on_release: self.parent.parent.ids.calc_input.text += self.text
size_hint: None, None
font_size: self.parent.parent.button_font_size
width: self.parent.parent.button_width
height: self.parent.parent.button_height

<Calculator_Widget>:
RowLayout:
    RowLayout:
        NumberButton:
        text: '1'
        NumberButton:
        text: '2'
        NumberButton:
        text: '3'

`

What do you mean by a few ‘parent’ and ‘ids here?
I don't know how to understand 'parent' and 'ids'
thank you!

In addition:
I put it here
Self.parent.parent.ids.calc_input.text + = self.text
Change into
Root.ids.calc_input.text + = self.text
or
Root.parent.parent.ids.calc_input.text + = self.text
Will it go wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant