Canvas GUI: Difference between revisions

Jump to navigation Jump to search
m (→‎Replacing native PUI widgets with Canvas widgets: removing this: no longer need, widget support has considerably improved since then ...)
Line 59: Line 59:
Canvas dialogs are definitely the way to go, as they are far more flexible and will replace PUI in the future. Since I think FG 2.11 you can create canvas dialogs with window decoration, including a title bar allowing to drag the window around and a close icon:
Canvas dialogs are definitely the way to go, as they are far more flexible and will replace PUI in the future. Since I think FG 2.11 you can create canvas dialogs with window decoration, including a title bar allowing to drag the window around and a close icon:


<pre>
<syntaxhighlight lang="nasal">
var dlg = canvas.Window.new([400,300], "dialog")
var dlg = canvas.Window.new([400,300], "dialog")
                                     .set("title", "My Canvas Dialog...");
                                     .set("title", "My Canvas Dialog...");
</pre>
</syntaxhighlight>


The existing XML dialogs can still be used and will also be usable in the future (by a backwards compatibility layer or some migration path).  
The existing XML dialogs can still be used and will also be usable in the future (by a backwards compatibility layer or some migration path).  

Navigation menu