Lingo Dictionary > O-R > on runPropertyDialog |  |

on runPropertyDialog

Syntax

    on runPropertyDialog me, currentInitializerList
    	statement(s)
    end

Description

System message and event handler; contains Lingo that defines specific values for a behavior's parameters in the Parameters dialog box. The `runPropertyDialog` message is sent whenever the behavior is attached to a sprite, or when the user changes the initial property values of a sprite's behavior.

The current settings for a behavior's initial properties are passed to the handler as a property list. If the `on runPropertyDialog` handler is not defined within the behavior, Director runs a behavior customization dialog box based on the property list returned by the `on getPropertyDescriptionList` handler.

Example

This handler overrides the behavior's values set in the Parameters dialog box for the behavior. New values are contained in the list `currentInitializerList`. Normally, the Parameters dialog box allows the user to set the mass and gravitational constants. However, this handler assigns these parameters constant values without displaying a dialog box:

    property mass
    property gravitationalConstant
    on runPropertyDialog me, currentInitializerList
    	--force mass to 10
    	setaProp currentInitializerList, #mass, 10
    	-- force gravitationalConstant to 9.8
    	setaProp currentInitializerList, #gravitationalConstant, 9.8
    	return currentInitializerList
    end

See also

`on getBehaviorDescription`, `on getPropertyDescriptionList`