Skip to content

Instantly share code, notes, and snippets.

Created October 7, 2016 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/5d2a3e28f50d8dea3ff82b8b6638a286 to your computer and use it in GitHub Desktop.
Save anonymous/5d2a3e28f50d8dea3ff82b8b6638a286 to your computer and use it in GitHub Desktop.
Component* PageListBoxModel::refreshComponentForRow(int row, bool selected, Component* existingComponent){
if (controller != nullptr){
String s(controller->getPageNames()[row]);
if (existingComponent == nullptr){
PageListBoxRowComponent* p = new PageListBoxRowComponent(s, selected, this, row);
p->addListener(this);
rowComponents.add(p);
return p;
}else{
PageListBoxRowComponent* p = (PageListBoxRowComponent*)existingComponent;
p->setRow(row);
p->setName(s);
return existingComponent;
}
}else{
return nullptr;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment