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

Add support for ListBox component #2

Merged
merged 5 commits into from
May 24, 2024
Merged

Conversation

roblillack
Copy link
Owner

@roblillack roblillack commented May 16, 2024

Basic ListBox support. Currently only implemented for FLTK, as gocoa does not support NSTable yet.

Example:

val, setVal := spot.SetState[int](0);

…

&ui.ListBox{
    X: 50, Y: 50, Width: 100, Height: 50,
    Values:    []string{"Null", "Eins", "Zwei", "Drei", "Vier", "Fünf", "Sechs", "Sieben", "Acht", "Neun"},
    Selection: []int{val},
    OnSelect: func(s []int) {
        if len(s) > 0 {
            setVal(s[0])
        }
    },
}

Looks roughly like this:

image image

@roblillack roblillack self-assigned this May 16, 2024
@roblillack roblillack marked this pull request as draft May 16, 2024 18:42
@roblillack roblillack force-pushed the add-support-for-listboxes branch 4 times, most recently from 964dcff to 50d135f Compare May 17, 2024 07:43
@roblillack roblillack force-pushed the add-support-for-listboxes branch from 50d135f to 575f8dd Compare May 23, 2024 20:05
@roblillack roblillack marked this pull request as ready for review May 24, 2024 13:06
@roblillack roblillack merged commit 846ebba into main May 24, 2024
@roblillack roblillack deleted the add-support-for-listboxes branch May 24, 2024 13:07
roblillack added a commit that referenced this pull request May 27, 2024
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.

1 participant