20,741
edits
No edit summary |
|||
Line 5: | Line 5: | ||
== Registering the pre-processor == | == Registering the pre-processor == | ||
{{Note|This works analogous to the existing addcommand() API - but it will be treated like an fgcommand that gets a handle to the widgets props.Node via the cmdarg() API. That way, the whole thing is mutable, too. In other words, the following 5 lines of code can be used to customize widgets and create entirely new ones in scripting space. | |||
}} | |||
<syntaxhighlight lang="nasal"> | <syntaxhighlight lang="nasal"> | ||
fgcommand("register-widget", props.Node.new({ | fgcommand("register-widget", props.Node.new({ | ||
Line 12: | Line 14: | ||
})); | })); | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== Testing the new tag/widget == | == Testing the new tag/widget == |