Howto:Adding a canvas to a GUI dialog: Difference between revisions

Jump to navigation Jump to search
m
no edit summary
mNo edit summary
Line 1: Line 1:
{{Template:Canvas Navigation}}
{{Template:Canvas Navigation}}


You can just open an existing dialog from $FG_ROOT/gui/dialogs, and copy a simple dialog like the exit/about dialog, and customize it according to your needs - i.e. by naming it "fgplot.xml",  remove any stuff that you don't need, then add a new canvas widget to the dialog, like this:
Using the combination of Nasal scripting, GUI dialogs and embedded canvas regions for 2D rendering, you can create standalone "FlightGear applications" in the form of self-contained dialogs that you can easily share with fellow FlightGear users. This can for example be used to create a plotting application like [[FGPlot]], which would look to FlightGear like a conventional dialog.
 
To create a new canvas dialog, you can just open an existing dialog from $FG_ROOT/gui/dialogs (e.e.g copy a simple dialog like the exit/about dialog), and then customize it according to your needs - i.e. by naming it "fgplot.xml",  remove any stuff that you don't need, then add a new canvas widget to the dialog, like this:


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">

Navigation menu