Name: newWidget

Type: message

Syntax: newWidget

Summary:
Sent to a new <widget> right after it's created.

Associations: widget

Introduced: 8.0

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Example:
on newWidget -- set tooltips of new widgets
    set the tooltip of the target to the kind of the target
end newWidget

Description:
Handle the <newWidget> <message> if you want to create additional
<object|objects>, switch <tool|tools>, or do other tasks when a new
<widget> is created.

Normally, the <newWidget> <message> is handled at a higher level of the
<message path>, since the newly created <widget> does not yet have a
<script>. 

The <newWidget> <message> is sent after the <widget> is created, so
<trap|trapping> the <message> and not allowing it to <pass> does not
prevent the <widget> from being created.

References: copy (command), clone (command), paste (command),
pass (control structure), object (glossary), trap (glossary),
message (glossary), tool (glossary), message path (glossary),
widget (object), script (property)

Tags: objects

