dlg_comp_name()

Gets or sets the name text of a component within a dialog.

Syntax

planetcnc.dlg_comp_name(component)
planetcnc.dlg_comp_name(component, name)

Parameters

Parameter Type Description Comment
component capsule Capsule object representing the component.
name string New name text for the component (optional). optional

Return Value

Examples

#! /usr/bin/env python
 
import planetcnc
 
# Get the current name of a component
current_name = planetcnc.dlg_comp_name(my_component)
print("Current name:", current_name)
 
# Set a new name for the component
planetcnc.dlg_comp_name(my_component, "New Component Name")
 
print("Component name updated.")

See also

dlg_comp_pos
dlg_comp_size
dlg_comp_color
dlg_comp_font
dlg_comp_name
dlg_comp_value
dlg_comp_callback