In this example we will create a combobox with 1000 items.
We will start with the normal creation of window stuff:
Next we will create a box.
And now we create our combobox and set some of it's properties. We set win
as its parent, set a text "A Simple List" (which acts as a placeholder). We pack the combobox in box.
Next we create a new genlist item class and sets its properties: item_style as deafult , callback for text_get and set others as NULL.
Next we will append 1000 items to the combobox, this is similar to appending items to the genlist
We also set a pair of callbacks to be called whenever any item is selected or pressed. when the combobox is activated, dismissed, expanded :
And then ask that our combobox be shown and run the main loop:
We now have the callback for setting text in the each item of genlist:
Next we have the callback which is called when the combobox is clicked:
Next we have the callback that is called whenever an item is selected and text of that item is set on combobox:
Next we have the callback that is called whenever an item is pressed and text of that item is set on combobox and the hover is closed:
Next we have the callback that is called whenever an item is double-clicked or pressing (enter|return|spacebar) on an item also the text(event_info) of that item is set on combobox and the hover is closed:
And the callback that is called when the hover,genlist are closed.
And finally the callback is called when hover,genlist are shown.
Our example will initially look like this: