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

How to add Items to ComboBoxText #49

Open
Stefan99353 opened this issue Jun 21, 2020 · 1 comment
Open

How to add Items to ComboBoxText #49

Stefan99353 opened this issue Jun 21, 2020 · 1 comment

Comments

@Stefan99353
Copy link

I trying to make a ComboBox displaying some strings, but I can't figure out how I can add Items to the Combobox.

@pepijndevos
Copy link
Collaborator

I imagine that <ComboBox model=MyModel /> would work? I think that would map to https://gtk-rs.org/docs/gtk/trait.ComboBoxExt.html#tymethod.set_model

You'd have to pass it a TreeModel: https://gtk-rs.org/docs/gtk/struct.TreeModel.html

If you'd like something where you can say <ComboBoxText items=vec!() I think this requires writing a wrapper in https://github.com/bodil/vgtk/blob/master/vgtk/src/ext/mod.rs that calls the correct methods.

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

No branches or pull requests

2 participants