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


next up previous contents index
Next: barchart - Tool Up: guiutils - Module Previous: popupmenu - Function


addpopuphelp - Function



Package display
Module guiutils


add popup help to a GUI


Synopsis
addpopuphelp(agents, maxlevels) include "popuphelp.g"


Description
addpopuphelp Is a function which recurses through a data structure (typically this will be the ``private'' variable of your closure tool, and for every agent that it finds that has a field named ``shorthelp'', it will add the code necessary to add ``popup'' help to that agent.

It is advised to use the ``popuphelp'' function directly in stead.

Sometimes record/agent structures are set up where a subrecord is in fact a reference to a parent record. Since this might cause infinite recurses, a maxlevels parameter is used to prevent such infinite loops. It is set to 4 by default, which should generally suffice, but very deep structures may require this number to be raised.



Arguments

agents   structure that holds the agents
    Allowed: record or agent
maxlevels   maximum number of levels to recurse
    Allowed: 4


Returns
T (or fail)


Example
include 'popuphelp.g';
private := [=];
private.f := frame(height=100);
private.b := button(private.f);
private.b.shorthelp := 'Press the button';
private.l := listbox(private.f);
private.l->insert('AAA'); private.l->insert('BBB');
private.l.shorthelp := function(name, index) {
    # Only need name here.
    return spaste('Your cursor is near ', name);
}
addpopuphelp(private);





next up previous contents index
Next: barchart - Tool Up: guiutils - Module Previous: popupmenu - 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