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

Gui core trivial case extension #212

Open
Cooldude2606 opened this issue Apr 19, 2021 · 1 comment
Open

Gui core trivial case extension #212

Cooldude2606 opened this issue Apr 19, 2021 · 1 comment
Labels
Feature Request Request for a new feature to be added

Comments

@Cooldude2606
Copy link
Member

Feature overview
Name: Gui core trivial case extension
TL;DR: Allow the trivial case for a gui define to accept a non unique name when no events are used and an option for "provided by arguments" for element fields like name or caption being provided by an argument to the draw function.

Details
After reviewing #195 I found cases of where really short functions were being used for draw functions. These functions were very similar to the trivial case and to avoid repetition the trivial case should be extented to include these use cases. Allowing a non unique name is extremely simple but the provided by argument case is less trivial but still so coommon that it should be included.

Possible methods
Only a single if statement is required to allow non unique names, an "Id" field might be useful to avoid confussing.
For the provided values a constant from the gui module (such as "Gui.provided_argument") can be used as a signal for which fields are provided as arguments. Because of closures no extra data is required to be on the element object but for debug purposes this would be useful. The order in which fields are provided will determine the order in which the arguments should be provided.

@Cooldude2606 Cooldude2606 added the Feature Request Request for a new feature to be added label Apr 19, 2021
@Cooldude2606
Copy link
Member Author

Some work has been done on this: #253 coverted the core module to use tags for events which makes names optional even when event handlers are present. No work has been done to allow for the "provided by argument" case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Request for a new feature to be added
Projects
None yet
Development

No branches or pull requests

1 participant