GuiAddCtlText()

Sets the text for a control or window.

error = GuiAddCtlText(Control, Text, Options)


Args

Control is the control whose text is to be set. You should pass the name of the REXX variable that you associated with this control. The handle to the window containing this control must be stored in the GuiWindow variable, unless you qualify the control name with the object name. (See notes for details).

You can alternately pass a window handle for the Control arg. For example, you can pass the handle to your window (gotten from the GuiWindow variable set by GuiCreateWindow) to effect the window itself (as opposed to a particular control in the window), or pass a handle gotten with GuiGetCtl().

If Control is omitted, then the value of the GuiWindow variable is automatically used.

Text is new text for the window/control. What you supply here depends upon the type of control (or window). See the section Controls Reference for details.

Options are various options you can specify, and these options may vary depending upon the type of control (or window).

If Options is "LENGTH", then GuiAddCtlText calculates, and returns the pixel width/height of a string added to the control. It does not add the string to the control. This may be useful in figuring out how much to resize a control to accomodate a given string. GuiAddCtlText returns a string containing both the width and then the height, each separated by a space.


Returns

If successful, an empty string is returned. If an error, an error message.


Notes

If Control is omitted, or is a window that you have created, then Text is what you want to appear in the window's titlebar. You can omit the Options argument.

/* Set my window titlebar to "My Window" */
GuiAddCtlText(, "My Window")

/* Set my window titlebar to the value of MyVariable */
MyVariable = "This is my titlebar"
GuiAddCtlText(GuiWindow, MyVariable)