How about this feature for kivy lang?
See original GitHub issueI am new to kivy lang, and I am fascinated by it. I was trying to use kivy to build a tree layout UI, where each node in the tree should be a text input, and the tree may be dynamic. So I am wondering if the kivy lang can be made more powerful by adding conditions and for loops. Here is an imaginary kivy file with the new power on:
RootWidget:
# a conditional example
Button if root.need_button:
text: 'press me'
else Label:
text: 'feedback'
# a more complex one
Button if root.need_confirm:
text: 'Confirm'
else Label if root.need_label:
text: 'Nice Job!'
else Widget:
# empty widget here...
# here is a for loop example
Rectangle for data in root.data:
pos: data.pos
size: data.size
As I am new to kivy lang, clearly my idea could be totally out of place. Just ask around to see if this proposal is possible at all or plausible at all.
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Kivy Language — Kivy 2.1.0 documentation
The Kivy language is a language dedicated to describing user interface and interactions. You could compare this language to Qt's QML (http://qt.nokia.com), ...
Read more >How to use the kivy.lang.Builder function in Kivy - Snyk
properties import StringProperty, ObjectProperty, NumericProperty, ListProperty, BooleanProperty,\ OptionProperty, Clock from kivy.
Read more >Kivy language function call on button press using screens
I am trying to call a function within a screen from a button press and I want to facilitate this with a kv...
Read more >Kivy Part 4 - Using Python and the Kivy Language
We already have a basic Kivy app in Python, but in Kivy we can also use a special Kivy language which is used...
Read more >Kivy Documentation - Read the Docs
Learn: The basics of programming with the Kivy language. ... versionadded:: to mark the version in which the feature was added.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We would suggest making a pr if you’d like to see if your proposal is viable, but we don’t plan to work on this in its current form.
@KeyWeeUsr that switch_with is a nice option, however it might not be as flexible. A cooked up example of interest may look like this:
As for efficiency, an idea is that kv could be translated into python equivalent.