Programming Guide |
Displays a message at a given column on the status line
void sm_msg(int column, int disp_length, char *text);
column
- The message's start column on the status line. On terminals with onscreen attributes, you might need to adjust the column position to allow for attributes embedded in the status line.
sm_d_msg_line
explains how to embed attributes and function key names in a status line message.disp_length
- The number of characters to display.
text
- The contents of the message.
sm_msg
merges the specified message with the current contents of the status line and displays it at the specified column. This function is called by the function that updates the cursor position display (refer to sm_c_vis).Note: Messages generated by
sm_msg
have the lowest of priority among status line messages; consequently, its display is guaranteed only until the function returns to its caller, or until another message routine is called. Any messages that are subsequently posted to the status line overwrite thesm_msg
-generated text.
#include <smdefs.h>
/* This code displays a message, then chops out
* part of it.
*/
char *text0 = " ";
char *text1 = "Message is displayed on the status "
"line at col 1.";
sm_msg(1, strlen(text1), text1);
sm_msg(12, strlen(text0), text0);