This MWAPI tip was adapted from a contribution by
Michael Volke,
100042.1323@compuserve.com
If the height of a DOCUMENT gadget is such that the first line of text will not fit completely into it, then
All information in ^$WINDOW is correct, though, including the invisible characters which are in the VALUE node. It is not clear if this bug is due to Windows or Workstation. I saw it under Windows 95 OSR1 (4.00.950a), Fontface "System", Fontsize "10", Fontstyle "BOLD", screen resolution 800x600. $WFONT returned a font height of 16 pixel. Height of the DOCUMENT gadget was 19 pixel which is not enough because of the frame of the box. The bug immediately disappeared by increasing the gadget height to 20 pixel.
Why should anybody create a DOCUMENT gadget with a height of only one line (actually by accident a little bit less) ? Since one can have an event for every character typed and the size of a gadget can be modified even after creation, one can create applications with text boxes adapting to the amount of text entered, such that text never becomes invisible, regardless of initial box size and text length. In such an application, it makes sense to start with DOCUMENT gadgets only one line high. A little additional housekeeping is required, since gadgets below the text box have to be shifted downwards or upwards as the box expands or shrinks.