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


next up previous contents index
Next: messageline - Constructor Up: widgets - Module Previous: menuframes.state - Function


messageline - Tool



Package display
Module widgets


Postscript file available

Tk widget to display and log one-line messages.

include "messageline.g"

Constructors
messageline Construct a messageline
Functions
clear Clear the contents of the widget
done Destroy the widget
post Post a message to the widget and the logger
postnoforward Post a message to the widget



Description

This simple Tk widget is a place for a complex GUI to display one-line messages (typically on the status of the task being controlled by the GUI) and simultaneously log those messages to the AIPS++ logger via the note function.

The messageline widget is in many ways just like an entry widget. The messageline widget supports these entry widget events: background, bind, borderwidth, exportselection, font, foreground, justify, relief, view, and width. These events are all forwarded directly to the underlying entry widget.

In addition, the following three events control the displayed text:

post
This is what you use to display a message and send it off to the logger. It takes a single argument, the message.
postnoforward
Use this to display a message which should not be logged. It takes a single argument, the message.
clear
This clears the message.

All events emitted by the underlying entry widget are re-emitted by this widget. These events will be any events due to binds set through the bind event plus the xscroll event. The xscroll event, along with the view event, allows a horizontal scrollbar to be associated with this widget just as you would the entry widget.

The widget can be destroyed using the done function.



Example
include 'messageline.g'   
f := frame()
ml := messageline(f)
ml->post('This message is displayed and logged.')
ml->postnoforward('This message is just displayed.')
ml->clear() # the widget is now cleared
# optionally add a scrollbar, if you think the messages might get long
sb := scrollbar(f, orient='horizontal');
whenever sb->scroll do {ml->view($value);}
whenever ml->xscroll do {sb->view($value);}




next up previous contents index
Next: messageline - Constructor Up: widgets - Module Previous: menuframes.state - 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