Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: guiframework.cleanup - Function Up: guiframework - Tool Previous: guiframework.updatetitle - Function


guiframework.addactionhandler - Function



Package display
Module guiutils
Tool guiframework


Sets the handler for a menu or command buttion


Synopsis
addactionhandler(button, action)


Arguments

button   button name
    Allowed: String
    Default: Valid button name
action   action functions
    Allowed: Glish function
    Default: Valid function


Returns
Nothing


Description
Sometimes it's not possible to prescribe a button/menu action before construction of the framework. Addactionhandler allows you do this after the tool is created. A typical example is a menu exit or an action dismiss button.

The following code excerpt illustrates adding a command action.

action := [=];
action.dismiss := [=];
action.dismiss.text = 'Dismiss';

a := guiframework('My window', F, F, action);
a.addactionhandler('dismiss', a.dismiss());

This code excerpt illustrates adding a menu action. Note that for menus we concatenate the menu button names to produce the proper button name. So, the dismiss option of the file menu has a name of filedismiss. If you have cascading menus, you just keep concatenating names, i.e. options, browser, netscape becomes optionsbrowsernetscape.

menus := [=];
menus.file := [=];
menus.file::text := 'File';
.
.
.
menus.file.dismiss := [=];
menus.file.dismiss.text := 'Dismiss'
menus.options := [=];
.
.
.
a := guiframework('My app', menus, T, T)
a.addactionhandler('filedismiss', a.dismiss);





next up previous contents index
Next: guiframework.cleanup - Function Up: guiframework - Tool Previous: guiframework.updatetitle - Function   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15