Skip to content

Instantly share code, notes, and snippets.

@NachoMan
Created October 15, 2009 15:58
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 NachoMan/211046 to your computer and use it in GitHub Desktop.
Save NachoMan/211046 to your computer and use it in GitHub Desktop.
function deleteItem() { /* ... */ }
function doAction(buttonIndex, buttonLabel) {
if (buttonIndex == 0) {
/* Edit clicked */
} else if (buttonIndex == 1) {
/* Rename clicked */
}
}
dialog.openButtonDialog(
"What do you want to do?",
{ label: "Edit" },
{ label: "Rename" },
{ label: "Delete", type: "destroy", onClick: deleteItem },
{ label: "Cancel", type: "cancel" },
{ style: "translucent", onClick: doAction }
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment