Selecting in a list


10-02-2008 17:21:54

Is it possible to select items in a List? It doesn't look like it but I could be wrong.


10-02-2008 17:40:43

A ComboBox has the notion of a selection, a list doesn't. Maybe these functions are what you're looking for:

Widget* getItem(unsigned int index);
int getItemIndex(Widget* w);
int getNumberOfItems();


10-02-2008 20:17:36

Not quite. What I want to do is let the user select an item(I'm using the list to display server ip's). So then they can choose their host to connect to. A combobox doesn't quite look nice enough.

Do you think it would be difficult to implement selected in the List widget? Perhaps copying/modifying some of the combobox code?


11-02-2008 01:34:56

I'll have to look into it some, it might not be a lot of work to implement..


11-02-2008 01:49:21

I'll try too. I tried earlier today but didn't go whole hearted into it. I was too busy brewing beer. :lol:


11-02-2008 04:26:27

haha, nice! Well like you said the ComboBox widget already has item selection, and since the ComboBox widget makes use of the List widget, I'd want to add the Selection property to the List widget, and allow users to show/hide the selection.