Skip to content

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.

ckrowland pushed a commit to ckrowland/zgui that referenced this pull request Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants