Daylight v4.9
Release Date: 1 February 2008

Name

dw_msg - message widget

C Prototype

#include <X11/Xlib.h>
#include <xview/xview.h>
#include "dw_xv_widget.h"

/*** Standard widget functions ***/

int dw_msg_create (Frame parent );
void dw_msg_destroy (int id );
void dw_msg_hide (int id );
void dw_msg_redraw (int id );
void dw_msg_reset (int id );
void dw_msg_setlabel(int id, char *label);
void dw_msg_show (int id );

/*** Functions specific to the message widget ***/

int dy_msg_invoke(int id);

Description

The message widget is a convenient way of allowing the user to browse the messages set to the error facility provided by the Daylight Toolkit.

Although any number of message widgets can exist concurrently, only one is used in typical application programs. The first message widget to be created is treated specially, it can be referred to with widget id 0 (so functions can invoke it without knowing its id). The message widget should be the first widget created because other widgets use it for error reporting.

dw_msg_create(Frame parent) => int

Create a message widget as a child of XView Frame parent. The widget is initially empty and is not visible. A positive widget id is returned on success; 0 is returned on error.

dw_msg_destroy(int id) => void

Destroy the given message widget.

dw_msg_hide(int id) => void

Unconditionally hide the given message widget.

dw_msg_invoke(int id) => int

Invoke message widget id; if id is zero, invoke the root message widget. If there are no messages in the queue, this is a quick no-op. Otherwise, message queue will be displayed with the latest messages visible. 1 is returned on success, 0 on error.

dw_msg_redraw(int id) => void

Refresh the given widget.

dw_msg_reset(int id) => void

Clear the given message widget.

dw_msg_setlabel(int id, char *label) => void

Set the label on the given message widget. A value of NULL sets the default label.

dw_msg_show(int id) => void

Make the given message widget visible. This is not typically needed, since dw_msg_invoke() automatically makes the widget visible if there are any new messages in the error queue.

Return Value

No error messages are generated by this widget.

Release 4.2 is the first release of this widget. The 4.3 Message Widget is functionally identical to the 4.3 version.

Bugs

This widget should probably provide options for the initial frame position.

If messages have been written into the message widget's text subwindow when the parent frame is destroyed, XView will request a confirmation before destroying the widget, which is sort of annoying. Calling dw_msg_destroy() before quitting avoids this problem, but doing so shouldn't be necessary.

Related Topics

Daylight Widget User's Guide
Daylight Widget Programmer's Guide
$DY_ROOT/contrib/daylight/widgets/msg_usage.c