GUIKit Example: ActionApp
CodeDefinition
| Out[4]= |  |
ExampleThis example illustrates how to take advantage of Widget["Action"] objects and easily connect and construct typical user interface elements, such as menu items, toolbars, contextual popup menus and buttons. This example also highlights the following: Using icon resources relative to the widget definition Constructing menu item widgets Assigning a contextual pop-up menu (alternate mouse clicking) to another widget Defining names, tooltips, accelerator keystrokes, and icons for an action reused by all other widgets and globally controlling application state though the action widgets
Optional : Localization ExampleSince the ActionApp example centralizes most definitions of the user interface with the action widgets, it is also relatively easy to add localized versions of the application for many languages and locales. The following variant of the ActionApp widget definition demonstrates one way in which to organize localized data for a widget definition. NOTE: The localized strings for the sample languages are not accurate and are only implemented to illustrate how a localized version might appear. Some localizations may not display completely on your machine if certain language fonts and resources are not installed. In this sample technique for localizing content, we add a KeyString["key"] function that uses Mathematica to load and find localized definitions in the filesystem relative to the widget definition. One benefit of the definition itself being a Mathematica expression is that we can write tools to identify what keys we are using to implement a localized resource. Definition
| Out[5]= |  |
|