Skip to content

Added some necessary functions #41

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 3 commits into from
May 5, 2025
Merged

Conversation

Nefistofeles
Copy link
Contributor

No description provided.

pub const ListBox = struct {
current_item: *i32,
items: []const [*:0]const u8,
height_in_items: i32 = -1,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this a redundant field? Can we just use the length of items?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

height_in_items indicates how many lines are visible.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah makes sense, thanks!
What do you think about using ?u16 here instead?

@hazeycode hazeycode merged commit 87d678b into zig-gamedev:main May 5, 2025
3 checks passed
@hazeycode
Copy link
Member

hazeycode commented May 5, 2025

Thanks. I left some comments but this can be merged now.
Should review the API design re. types and ABI compat.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants