Skip to content

Message Panel

Message Panel Screenshot

Message panels display information to the user and wait for acknowledgment. Use them for confirmations, errors, and status messages.

Basic Usage

from ux3270.dialog import show_message

# Simple message
show_message("Operation completed successfully")

# With type
show_message("Record saved", msg_type="success")
show_message("Invalid input", msg_type="error")
show_message("Are you sure?", msg_type="warning")

Message Types

Type Color Usage
info Turquoise General information (default)
success Green Successful operations
error Red Error messages
warning Yellow Warnings

With Title and Panel ID

show_message(
    "The record has been deleted",
    msg_type="success",
    title="DELETE COMPLETE",
    panel_id="MSG01"
)

Using MessagePanel Class

For more control, use the class directly:

from ux3270.dialog import MessagePanel

panel = MessagePanel(
    message="Are you sure you want to delete this record?",
    msg_type="warning",
    title="CONFIRM DELETE"
)
panel.show()

API Reference

ux3270.dialog.show_message(message, msg_type='info', panel_id='', title='')

Convenience function to display a message panel.

Parameters:

Name Type Description Default
message str

The message to display

required
msg_type str

One of "error", "success", "warning", "info"

'info'
panel_id str

Optional panel identifier

''
title str

Optional title

''

ux3270.dialog.MessagePanel

CUA-style message panel for displaying information to the user.

This is an information panel - displays a message and waits for acknowledgment (Enter or F3). No command line per CUA conventions for simple information panels.

The dialog builds a Screen definition and hands control to Screen for all rendering and input handling.

__init__(message='', msg_type='info', panel_id='', title='')

Initialize a message panel.

Parameters:

Name Type Description Default
message str

The message to display

''
msg_type str

One of "error", "success", "warning", "info"

'info'
panel_id str

Optional panel identifier

''
title str

Optional title

''

show()

Display the message and wait for user acknowledgment.