Howto:Creating a Canvas GUI dialog file: Difference between revisions

Jump to navigation Jump to search
Line 33: Line 33:
<!--
<!--
{{Note|These dialog files can be edited at run-time and simply closed/re-opened, because the Canvas system will reload them from disk whenever the menu binding is triggered. So this is very convenient for quickly developing and testing your dialogs. For testing purposes, you can also paste the snippet into your [[Nasal Console]] and directly execute it.}}-->
{{Note|These dialog files can be edited at run-time and simply closed/re-opened, because the Canvas system will reload them from disk whenever the menu binding is triggered. So this is very convenient for quickly developing and testing your dialogs. For testing purposes, you can also paste the snippet into your [[Nasal Console]] and directly execute it.}}-->
Next, navitate to {{Fgdata file|Nasal/canvas/gui/dialogs) and open/create $FG_ROOT/Nasal/canvas/gui/dialogs/CanvasDemo.nas to add some boilerplate code:
Next, navitate to {{Fgdata file|Nasal/canvas/gui/dialogs}} and open/create $FG_ROOT/Nasal/canvas/gui/dialogs/CanvasDemo.nas to add some boilerplate code:
<syntaxhighlight lang="nasal">
<syntaxhighlight lang="nasal">
var DemoDialog = {
var DemoDialog = {
Line 72: Line 72:


For a more sophisticated example, refer to [[Howto:Reset/re-init Troubleshooting]].
For a more sophisticated example, refer to [[Howto:Reset/re-init Troubleshooting]].
== Adding Widgets ==
== Adding Widgets ==
{{Main article|Howto:Creating a Canvas GUI Widget}}
{{Main article|Howto:Creating a Canvas GUI Widget}}

Navigation menu