The Button object provides an API to a button component in the Customize Klip window which can be
accessed by clicking on the Menu button of your Klip's title bar or by right-clicking anywhere in the Klip.
Use myTab.addButton() to add a button to a tab, where myTab is a Tab object.
Example
The following onLoad() function creates a new tab called 'New Tab' in the Customize Klip window, then adds a button called 'New Button', as shown on the right.
function onLoad() {
// Create a new tab
var tab = Setup.addTab( "New Tab" );
// Add a button to the tab
button = tab.addButton( "New Button" );
button.url = "http://www.klipfolio.com/";
}
Each Tab object in the Setup array corresponds to a tab in a Klip's Customize Klip window.
Each Tab object can have multiple UI components, and each Klip can have multiple tabs. Use the Button, Checkbox, ComboBox, ListControl, Spacer, Text, TextArea, and TextField objects in a tab to enable users to configure the Klip to their preferences.
Buttons typically open a url in a new web page (as shown in the example)
or cause Klipfolio Dashboard to execute a handler function defined using the onClick() property.
| Properties Summary | |
boolean |
disabled
The enabled/disabled state of this button. |
String |
url
The URL that Klipfolio Dashboard will open in the user's web browser when the button is clicked. |
String |
value
The label displayed by this button. |
| Function Summary | |
function
|
onClick()
Specifies a Handler Function for Klipfolio Dashboard to call when the user clicks the button. |
| Properties Detail |
disabled
boolean disabled
-
The enabled/disabled state of this button. The default value is false.
url
String url
-
The URL that Klipfolio Dashboard will open in the user's web browser when the button is clicked.
A button with a url defined does not require an onClick() handler function to open the URL.
value
String value
-
The label displayed by this button.
| Function Detail |
onClick
function onClick()
- Specifies a Handler Function for Klipfolio Dashboard to call when the user clicks the button.
Example:
The following Klip creates a new tab called 'New Tab', then adds a
button called 'New Button'
and assigns it the handler function button_onClick.

You clicked the button: New Button
Klipfolio Dashboard executes the handler function (if one is defined) for a button before checking the url property. This allows you to dynamically assign a URL when the user clicks the button. When the Handler Function exits, Klipfolio Dashboard opens the url (if defined) in the user's web browser.
|
Klipfolio Dashboard 5 API | ||||||||
| PREV OBJECT NEXT OBJECT | FRAMES NO FRAMES | ||||||||
| SUMMARY: PROPERTY | FUNCTION | DETAIL: PROPERTY | FUNCTION | ||||||||
© 2009 Klipfolio Inc. All Rights Reserved.

