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


next up previous contents index
Next: combobox.canclearpopup - Function Up: combobox - Tool Previous: combobox.getentry - Function


combobox.addonreturn - Function



Package display
Module widgets
Tool combobox


Sets the behavior when the user presses return in the entry.


Synopsis
addonreturn(addonreturn)


Arguments

addonreturn The requested behavior
Allowed: T or F


Description
When the argument is T, a return automatically adds the contents of the entry to the combobox internal data, when it is F, nothing happens. Typically, when this attribute is F the application will wait for return events from the combobox and examine the value of the entry before deciding if it should be added to the internal combobox data or not. The default behavior is to always add values on return, or T.


Example
        f := frame()
        cb := combobox(f,'colors',"red blue green yellow amber saffron")
        cb.addonreturn(F)
        whenever cb.agent()->return do {
            newitem := $value
            if (newitem != cb.get('selected')) {
                # only add a new item if it isn't what is currently
                # selected
               	cb.insert(newitem, select=T)
                # when added, insert it via current autoinsertorder
               	# and select it
            }
       	}




next up previous contents index
Next: combobox.canclearpopup - Function Up: combobox - Tool Previous: combobox.getentry - 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