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

passing &ui to every single method in the entire library #92

Open
LoganDark opened this issue Jul 8, 2020 · 2 comments
Open

passing &ui to every single method in the entire library #92

LoganDark opened this issue Jul 8, 2020 · 2 comments
Labels
c-enhancement New feature or request c-question Further information is requested p-high High Priority x-help wanted Extra attention is needed
Milestone

Comments

@LoganDark
Copy link

This is just a bit annoying.

Is there any other way this could be done? Perhaps the UI specified during creation could be stored in a field of the struct, like this:

image

That way you wouldn't have to also specify this UI object to every single method you call on that object.

In fact this could be done in a non-breaking way by preserving the original methods which take the &UI argument, and simply deprecating them.

small semver note:
This library is still in version 0 ("rapid prototyping phase"), so you don't need to increment major for breaking changes. Anyone using this library should be doing iui = "~0.3.0" or similar. It is definitely possible to make version 0.4.0 a breaking change. Although deprecating methods now and then removing them in version 1.0.0 would be preferable.

@NoraCodes
Copy link
Collaborator

A fix to this is planned in 0.5.0, and I appreciate your input! I'll definitely look into that approach, but there is some complexity there because libui doesn't give us as much access to memory management as I'd like.

This library is still in version 0 ("rapid prototyping phase"), so you don't need to increment major for breaking changes.

We are aware of this.

@NoraCodes NoraCodes added c-enhancement New feature or request c-question Further information is requested p-high High Priority x-help wanted Extra attention is needed labels Aug 5, 2020
@NoraCodes NoraCodes added this to the 0.5 Release milestone Aug 5, 2020
@LoganDark
Copy link
Author

LoganDark commented Aug 23, 2020

It seems like UI is just a token, that is:

  • By acquiring a UI, you initialize libui
  • By passing a UI to a component, you assure the component that libui is here, functional, and that we're calling from its thread

I don't see an immediate solution to this, so I see why the decision was made now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-enhancement New feature or request c-question Further information is requested p-high High Priority x-help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants