I am trying to make a multiple-select listbox in glade/ruby program and I am wondering how I go about doing this, like what element I add to the window and the corresponding example code I can use. I was looking at GTKList but it says it is deprecated now, and also I don’t know how to get it working in ruby. GTK List docs say to use TreeView, but I have no idea how to set that up.
Just to be clear, I would like something like this, where the user can select multiple entries:
alt text http://geekswithblogs.net/images/geekswithblogs_net/dotNETvinz/OutputPreselectListBox.JPG
Thanks for the help guys! I am really desperate on this question.
Basically, you have to use GtkTreeView and set its “model” property to a GtkListStore that contains your data.
GtkTreeView manages selection with GtkTreeSelection class. Use gtk_tree_view_get_selection (or whatever it is mapped to in ruby-gtk) to get the GtkTreeSelection. And set the selection mode to “multiple”.
Here’s an example in Python. In Ruby/Gtk it should be similar.