Programming Guide



sm_setstatus

Turns alternating background status message on or off

void sm_setstatus(int mode);

mode
Specifies whether to turn the alternating status message on or off:

1

Turns the status message on.

0

Turns the status message off.


Environment

Character-mode

Description

When alternating messages are turned on, one message—typically Ready—displays on the status line while Panther awaits input, and another—normally Wait—when it is not. If mode is 0, the messages are turned off.

The status flags are replaced temporarily by messages passed to sm_ferr_reset and related functions. They overwrite messages posted by sm_d_msg_line and sm_setbkstat.

You can edit the text of alternating messages in the message file, where they are stored as SM_READY and SM_WAIT. You can also embed attribute changes and function key names in these messages, as described in sm_d_msg_line.

Example

#include <smdefs.h>
#include <smerror.h>
#define PAUSE (sm_flush(), sleep(3))
char buf[100];

/* Tell people what you're going to tell them. */
sprintf (buf, "You will soon see %s alternating "
"with %s below.",
sm_msg_get(SM_READY), sm_msg_get(SM_WAIT));
sm_do_region(3, 0, 80, WHITE, buf);

/* Now tell them. */
sm_setstatus(1);
PAUSE; /* Shows WAIT */
sm_input(IN_DATA); /* Shows READY */

/* Finally, tell them what you told them. */
sprintf(buf, "That was %s alternating with %s "
"on the status line.",
sm_msg_get(SM_READY), sm_msg_get(SM_WAIT));
sm_ferr_reset (0, buf);

See Also

sm_setbkstat