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

Widget creator #36

Open
codyduong opened this issue Aug 16, 2024 · 1 comment
Open

Widget creator #36

codyduong opened this issue Aug 16, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request experimental Changes for an unstable/experimental api priority high question Further information is requested
Milestone

Comments

@codyduong
Copy link
Owner

We need a method to easily obtain a specific UserData for a widget rather than going (get_widgets) on the bar, then the child, and so on.

local my_widget = hitokage.unstable.widget.create(
  { Box = { ... } }
);

It would have to return a Some<BoxUserData>, which we would have to query :is_ready() on.

Alternatively, we can implement a utility function on BarUserData. Store all ids somewhere.

bar:get_widget_by_id()
bar:get_widgets_by_type(type)
@codyduong codyduong added enhancement New feature or request question Further information is requested priority high experimental Changes for an unstable/experimental api labels Aug 16, 2024
@codyduong codyduong added this to the 0.1.0 milestone Aug 16, 2024
@codyduong codyduong self-assigned this Aug 16, 2024
@codyduong codyduong modified the milestones: 0.1.0, 0.2.0 Aug 17, 2024
@codyduong
Copy link
Owner Author

To accept props we would have to consider

local my_widget = hitokage.unstable.widget.create("MyWidget", function(props)
  { Box = { ... } }
end );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request experimental Changes for an unstable/experimental api priority high question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant