Archive 17/01/2023.

How Do You AddItem(UIElement*) to ListView?

practicing01

Edit: If ListView->SetSelection() takes an unsigned index then why does E_ITEMSELECTED return an int according to UIEvents.h?
SetSelection() is crashing for me btw, index returned from E_ITEMSELECTED is correct.

Edit: I gave up and split the lists. Items are not being highlighted when I click them though:

Hello, I can add multiple Text* to a ListView but when I try to add multiple UIElement*, it only adds one entry. Thanks for any help.

...
		SharedPtr<UIElement> serverInfo = ui_->LoadLayout(cache_->GetResource<XMLFile>("UI/serverInfo.xml"));
		((Text*)serverInfo->GetChild("serverName", true))->SetText(serverName);
		((Text*)serverInfo->GetChild("gameMode", true))->SetText(gameMode);
		((Text*)serverInfo->GetChild("address", true))->SetText(address);
		servers_.Push(serverInfo);

		((ListView*)gameMenu_->GetChild("serverList", true))->AddItem(serverInfo);
...