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

KEP001: Instantiate things other than widgets from kv #2061

Open
matham opened this issue Apr 7, 2014 · 4 comments
Open

KEP001: Instantiate things other than widgets from kv #2061

matham opened this issue Apr 7, 2014 · 4 comments
Labels
Component: KV-lang kivy/lang, factory Type: Feature Issue is a feature request

Comments

@matham
Copy link
Member

matham commented Apr 7, 2014

KEP (kv enhancement proposal) 001 instantiate other things than widgets from kv: https://github.com/kivy/kivy/wiki/KEP001:-Instantiate-things-other-than-widgets-from-kv

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@matham matham added the KEP label Apr 7, 2014
@ghost
Copy link

ghost commented Apr 8, 2014

Have you considered a 'properties:' or similar at the top level?

<SomeWidgetClass@Widget>:
    properties:
        NumericProperty:
            name: my_numeric
            default: 20
        StringProperty:
            name: my_string
            default: 'default value' # never binds, but can read id.prop values at instantiation
            value: str(root.my_numeric*2) # or some_id.propname; always binds

Seems a bit more consistent with the current canvas: syntax and might be easier/faster to parse (guessing). Maybe add 'animations:' and/or others.

Rgd id/name, my vote is to leave id for widgets; seems confusing to mix them.

@inclement
Copy link
Member

Of the given options, I like #5/6 the most, by a long way. I think the others are unnecessarily syntactically inconsistent with the rest of kv.

@matham
Copy link
Member Author

matham commented Apr 13, 2014

A few things we should be aware when implementing/deciding.

  • Not all properties take a value; e.g. AliasProperty doesn't take a value. So syntax shouldn't make us set a value.
  • For e.g. ReferenceListProperty and AliasProperty, some of the values are the names of other properties or a function name, these are not available from kv (e.g. x, and y here: https://github.com/kivy/kivy/blob/master/kivy/uix/widget.py#L840). Not sure how we'd deal with them other than by not allowing these properties from kv?

@stale
Copy link

stale bot commented Oct 7, 2017

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 7, 2017
@dessant dessant added the pinned label Oct 7, 2017
@stale stale bot removed the stale label Oct 7, 2017
@matham matham removed the pinned label Nov 1, 2020
@Julian-O Julian-O added Type: Feature Issue is a feature request Component: KV-lang kivy/lang, factory and removed KEP Proposals for Kivy labels Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: KV-lang kivy/lang, factory Type: Feature Issue is a feature request
Projects
None yet
Development

No branches or pull requests

4 participants