Phone API Reference - UI Classes (Widgets) - Widget (Base Class) - setSoftkeyIcon
Phone API Reference - UI Classes (Widgets) - Widget (Base Class) - setSoftkeyIcon
Â
setSoftkeyIcon
Description
Sets an image object to display at the top left corner of the softkey. Useful for indicating a hard key that calls the same handler. Suggested image size is 5x5 pixels.
Basic Example:Â
 exampleObj.setSoftkeyIcon(keyNum, icon); |
If you require the app library, you can use Digium's set of softkey icons. These image objects are created when the library is required.
app.images.softKeys.left (left arrow)
app.images.softKeys.right (right arrow)
app.images.softKeys.up (up arrow)
app.images.softKeys.down (down arrow)
app.images.softKeys.select (check mark)
app.images.softKeys.cancel (X)
Parameters
Name | Required | Type | Default | Description |
---|---|---|---|---|
keyNum | Yes | integer | Â | Softkeys are labeled 1-4. |
icon | Yes | widget | Â | Instance of a image widget for display. |
Examples
setSoftkeyIcon to set icons for the softkeys: Digium up arrow, Digium checkmark, custom icon
testWidget.setSoftkeyIcon(1, app.images.softKeys.up);
testWidget.setSoftkeyIcon(2, app.images.softKeys.select);
 Â
var imgWidget = new Image("app", "smileyface.png", 0, 0, 5, 5);
testWidget.setSoftkeyIcon(3, imgWidget); |
Â