Skip to content

Instantly share code, notes, and snippets.

@wbamberg
Created February 12, 2014 00:42
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 wbamberg/8947612 to your computer and use it in GitHub Desktop.
Save wbamberg/8947612 to your computer and use it in GitHub Desktop.
var { ToggleButton } = require("sdk/ui/button/toggle");
var { ActionButton } = require("sdk/ui/button/action");
var toggleButton = ToggleButton({
id: "my-toggle-button",
label: "toggle-default",
icon: {
"16": "./firefox-16.png",
"32": "./firefox-32.png"
},
onClick: updateToggleButtonLabelForThisWindow
});
var actionButton = ActionButton({
id: "my-action-button",
label: "action-default",
icon: {
"16": "./firefox-16.png",
"32": "./firefox-32.png"
},
onClick: updateActionButtonLabelForThisWindow
});
function updateToggleButtonLabelForThisWindow(state) {
toggleButton.state("window", {
label: "window-specific label"
});
}
function updateActionButtonLabelForThisWindow(state) {
actionButton.state("window", {
label: "window-specific label"
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment