dlg_set_btn()

Sets which buttons (Apply, OK, Close) are visible in the top-right corner of the dialog.

Can enable or disable all buttons or configure individual buttons.

Syntax

planetcnc.dlg_set_btn(handle, is_visible)
planetcnc.dlg_set_btn(handle, apply, ok, close)

Parameters

Parameter Type Description Comment
handle string Handle of the dialog to modify.
is_visible bool Show or hide all buttons. Used in 2-argument form.
apply bool Show or hide the “Apply” button. Used in 4-argument form.
ok bool Show or hide the “OK” button. Used in 4-argument form.
close bool Show or hide the “Close” button. Used in 4-argument form.

Return Value

Examples

#! /usr/bin/env python
 
import planetcnc
 
# Hide all buttons
dialog_handle = "MyDialogHandle"
planetcnc.dlg_set_btn(dialog_handle, False)
 
print("All buttons hidden.")
 
# Show only the "Apply" and "OK" buttons
planetcnc.dlg_set_btn(dialog_handle, True, True, True, False)
 
print("Apply and OK buttons visible, Close button hidden.")

See also

dlg_set_modal
dlg_set_resizable
dlg_set_pos
dlg_set_size
dlg_set_btn
dlg_set_name
dlg_set_color