System Console and Toolkit Tcl Command Reference Manual

ID 683101
Date 10/02/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.1.28. set_parameter_update_callback

Description

This command sets a tcl callback procedure for a parameter.This callback is called whenever the associated parameter value changes.The callback_proc will receive a single argument. If <optional_argument> is specified,the value of the argument to the callback <optional_argument> is used.Otherwise, the argument value will be the name of the parameter that was changed.This command allows one callback procedure to handle updates for multiple parameters.

Availability

GLOBAL

Usage

set_parameter_update_callback <name> <callback> [<opt-arg>]

ReturnType

Nothing

Returns

no return value

Arguments

name
Parameter name
callback
Update callback
opt-arg (optional)
Optional Arguments

Example

set_parameter_update_callback p1 p1_ui_tweak
proc p1_ui_tweak {arg} {
	 set p1 [get_parameter_value $arg]
	 set_parameter_value p2 [ expr $p1 / 4 ]
}
set_parameter_update_callback p2 ui_tweak Context1
set_parameter_update_callback p3 ui_tweak Context2
set_parameter_update_callback p4 ui_tweak Context2
proc ui_tweak {arg} {
	 if {$arg eq "Context1"} {
	 set_parameter_value p1 0
	 }
	 if {$arg eq "Context2"} {
		 set_parameter_value p1 1
	 }
}