Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jvcleave
Created January 4, 2012 05:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jvcleave/1558681 to your computer and use it in GitHub Desktop.
Save jvcleave/1558681 to your computer and use it in GitHub Desktop.
populate ofxSimpleGuiToo ComboBox with files
int fileID = 0;
vector<string> fileNames;
string fileExtension = "pex";
//
ofDirectory dir = ofToDataPath("", true);
dir.listDir();
vector<ofFile> files = dir.getFiles();
for(int i=0; i<files.size(); i++)
{
if (files[i].getExtension() == fileExtension)
{
fileNames.push_back(files[i].getFileName());
}
}
gui.addComboBox("SOURCE", fileID, fileNames.size(), &fileNames[0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment