Deleting an item
To remove an item of the select, we can use the following function.
ui_item_delete (control, index);
Return: True if successful
Argument control is the handle of ui_select_create(...);
function, the item is an index of the item to be removed.
selectCountry = ui_select_create (32, 64, ui_default, ui_default, "Country");
ui_item_add (selectCountry, "Indonesia");
ui_item_add (selectCountry, "Malaysia");
ui_item_add (selectCountry, "Thailand");
ui_item_add (selectCountry, "Vietnam");
ui_item_add (selectCountry, "Singapore");
ui_item_delete (selectCountry, 1);
The above line of code is used to delete items in index 1 that is "Malaysia" on selectCountry select.
Or we can add the handle as shown below.
selectCountry = ui_select_create (32, 64, ui_default, ui_default, "Country");
select0 = ui_item_add (selectCountry, "Indonesia");
select1 = tabui_item_add (selectCountry, "Malaysia");
ui_item_delete (selectCountry, select1);
The above line of code is used to delete the item select1 that is "Malaysia".