The CGUIDialogSelect is a part of the Kodi library which is commonly used for building user interfaces in media center applications. The function GetSelectedItem returns the index of the selected item in the dialog, starting from 0.
Code example:
// Create an instance of CGUIDialogSelect CGUIDialogSelect* selectDialog = new CGUIDialogSelect();
// Set the items for the dialog CGUIListItem item1("Item 1"); CGUIListItem item2("Item 2"); CGUIListItem item3("Item 3"); CGUIListItem item4("Item 4");
// Show the dialog and get the selected item if (selectDialog->DoModal() == ACTION_SELECT_ITEM) { int selectedItemIndex = selectDialog->GetSelectedItem(); }
In this example, we create a dialog with four items and show it to the user. When the user selects an item and confirms their selection, we use the GetSelectedItem function to retrieve the index of the selected item.
The package library for CGUIDialogSelect and Kodi is "kodi-platform".
C++ (Cpp) CGUIDialogSelect::GetSelectedItem - 29 examples found. These are the top rated real world C++ (Cpp) examples of CGUIDialogSelect::GetSelectedItem extracted from open source projects. You can rate examples to help us improve the quality of examples.