Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Wiki Markup
{alias:qcombobox}

Name

qcombobox — collapsable text entry box

...

To add items to the combo, use the qinsertitem command. To set the contents of the text field directly use qsetitemtext.

Arguments

cmds

One or more commands that are executed when the user selects an item in the combo. The item itself is appended to the list of commands before execution. It is the programmers responsibility to ensure that the resulting command is a valid Tcl command.

Examples

Ex.1: QComboBox

Anchor
QComboBox
QComboBox

No Format
bgColor#eeeeee
borderWidth1

# Callback for combo.
# The argument v is added by QTcl
proc show_value { v } {
	qinformation "Combo value " $v
}

set w [qwidget]
qsetwindowtitle QComboBox
qvboxlayout {
	# Combo 1
	qcombobox
	qadditem Red
	qadditem Green
	qadditem Blue

	# Combo with callback
	qcombobox show_value
	qadditems { Top Center Bottom }

}
qshow $w

...