dlg_add_dropbox

When adding a drop-down (combo box) component, you can include multiple items by providing a pipe-separated string.

For example:

These items will appear in the drop-down list in the order they are given.

Syntax

planetcnc.dlg_add_dropbox(handle, name, values, value=0, param=None)

Parameters

Parameter Type Description Comment
handle string Handle of the dialog to modify.
name string Name identifier for the drop-down component.
values string Pipe-separated string containing items. optional
value int Selected item. optional
param string Optional parameter name for value storage. optional

Return Value

Example

#! /usr/bin/env python
 
import planetcnc
 
dlg_handle = planetcnc.dlg_new("Examples")
 
# Add a drop-down component with four items: "Koko", "Pipi", "Bula", "Miki"
planetcnc.dlg_add_dropbox(dlg_handle, "Dropbox", "Koko;1|Pipi;2|Bula;3|Miki;4", 1)
 
planetcnc.dlg_show(dlg_handle)

In this example, the drop-down box will contain:

See also

dlg_add_option
dlg_add_separator
dlg_add_image
dlg_add_label
dlg_add_checkbox
dlg_add_num_input
dlg_add_txt_input
dlg_add_dropbox
dlg_add_button