Labels

A label widget is a widget that displays some text or bitmap but can not be clicked on or interacted with by the user. Generally a label is for informational purposes, such as saying what the current file name is.


Widget MakeLabel(char *txt);

This function creates a label that contains the text in the character string pointed to by "txt". The text will simply be displayed, with no fancy borders or special highlighting. If the text contains new line characters, they will be interpreted properly.

If the argument txt is NULL, then no label will be set for the widget. This is convienent if you plan to put a bitmap on this widget with the SetWidgetBitmap() function.

This widget is useful for displaying a piece of textual information like a filename or user name.

If this routine fails, a NULL is returned.

SEE ALSO : SetWidgetPos() , SetWidgetBitmap() , SetLabel(), SetWidgetFont() , SetFgColor() , SetBgColor() , SetBorderColor()


void SetLabel(Widget w, char *txt);

This function sets the widget's text to the character string pointed to by "txt". The widget makes a private copy, so the "txt" pointer may be freed afterwards.

The new string may be truncated to the right if it is longer than the original. The simplest workaround is to pad the initial string with blanks at creation time.

This function also works with widgets created by MakeButton() and MakeToggle().

SEE ALSO : MakeLabel() , MakeButton() , MakeToggle() , SetWidgetFont()