rcarlsen / ofxiPhoneWrappers
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (0)
- Wiki (1)
- Graphs
-
Branch:
master
Robert Carlsen (author)
Sat Aug 08 16:29:22 -0700 2009
| name | age | message | |
|---|---|---|---|
| |
README | Sat Jun 13 07:11:14 -0700 2009 | |
| |
ofxiPhoneAlertView.h | Wed Jun 10 12:36:08 -0700 2009 | |
| |
ofxiPhoneAlertView.mm |
README
Simple wrappers for UIKit classes, written as necessary.
ofxiPhoneAlertView:
// ofxiPhoneAlertView
// setup the list of buttons
vector<string> otherButtons;
otherButtons.push_back("Button 1");
otherButtons.push_back("Button 2");
// the args are: title, message, cancel button title ("" == omitted), vector of other button titles
ofxiPhoneAlertView *alert = new ofxiPhoneAlertView("Title","Here is the alert message.","",otherButtons);
// display the alert view
alert->show();
// I'm using the following methods in update()
// test if the alert is visible (bool):
alert->isVisible();
// test if the alert has been dismissed:
alert->isDismissed();
// get the selected button (int):
alert->getSelectedButton();
// if you use several alerts, you can distinguish between them via their title:
alert->getTitle();
// example logic:
switch(alert->getSelectedButton()){
case -1:
// cancel, or no selection
printf("alert = -1");
break;
case 0:
// first, non-cancel button
printf("alert = 0");
break;
case 1:
// next button. will be the second button after Cancel
printf("alert = 1, ok");
break;
}
