msg_show()

Displays a message (alert) dialog with optional icon, OK button, Cancel button and callback

Syntax

planetcnc.msg_show(icon, ok_btn, cancel_btn, callback, wait, title, message)

Parameters

Parameter Type Description Comment
icon int Icon type. 0 = No Icon, 1 = Info, 2 = Warning, 3 = Question.
ok_btn bool Show the OK button if True.
cancel_btn bool Show the Cancel button if True.
callback function Function to be executed when a button is clicked.
title string Title of the message dialog.
message string/object Text to display in the message. Numeric or other types are converted to string.

Return Value

Examples

#! /usr/bin/env python
 
import planetcnc
 
# Display a warning message with OK and Cancel buttons, no callback, no wait
result = planetcnc.msg_show(2, True, True, msg_cb, "Warning", "This is a warning message.")
print("Message result:", result)
 
# Display an information message with OK button, and wait for user response
result = planetcnc.msg_show(1, True, False, msg_cb, "Information", "Operation completed.")
print("Message result after user response:", result)

See also

msg
msgerr

msg_show

msg_count
msg_is_active

msg_click_ok
msg_click_cancel

bubble