Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Development Team/Almanac/sugar.graphics.toolbutton
(view source)
Revision as of 08:16, 23 April 2009
334 bytes added
,
08:16, 23 April 2009
→How do I reset the icon displayed for my tool button?
Line 43:
Line 43:
#Reset the icon displayed for customButton
#Reset the icon displayed for customButton
customButton.set_icon("edit-custom");
customButton.set_icon("edit-custom");
+
+
=== How do I add a keyboard shortcut to my tool button? ===
+
We typically use Alt characters for shortcuts within an activity, reserving Ctrl for system shortcuts. In the example below, we add the Alt-b short cut to our custom button.
+
+
#Add keyboard shortcut for customButton
+
customButton.props.accelerator = '<Alt>b'
Walter
Bureaucrats
,
Administrators
10,579
edits