dlg_comp_pos()

Sets the position of a component within a dialog.

If `y` is `-1`, the component is placed at the same position as the last one. If no position is specified, components are placed below the last one.

Syntax

planetcnc.dlg_comp_pos(component, x=None, y=None)

Parameters

Parameter Type Description Comment
component capsule Capsule object representing the component.
x int X-coordinate of the component (optional). optional
y int Y-coordinate of the component (-1 to keep last position). optional

Return Value

Examples

#! /usr/bin/env python
 
import planetcnc
 
# Move a component to position (50, 100)
planetcnc.dlg_comp_pos(my_component, 50, 100)
 
print("Component moved to (50, 100).")
 
# Keep the same X position but place the component below the last one
planetcnc.dlg_comp_pos(my_component, y=-1)
 
print("Component positioned below the last one.")

See also

dlg_comp_pos
dlg_comp_size
dlg_comp_color
dlg_comp_font
dlg_comp_name
dlg_comp_value
dlg_comp_callback