Canvas GUI

From FlightGear wiki
Jump to navigation Jump to search
Note  the GUI API documentation can be found here: Canvas GUI API

The Canvas GUI is going to replace the old PUI in version 2024.2.

The canvas menu in 2024.2 nightly.

Background

In order and switch to the core profile, the PUI will be phased out completely. We now have the Canvas system, and there’s a formal decision to modernize the GUI using the Canvas, and completely replace PUI sooner rather than later.

The shortcomings of PUI in particular, have been repeatedly brought up on the devel list over the years. It was a lot of work to get rid of hard-coded PUI dialogs, and we still have a bunch of hard-coded PUI widgets – as long as we have those, getting totally rid of PUI will be increasingly difficult, because each hard-coded widget will either need to be phased out or manually ported.

Creating canvas widgets

1rightarrow.png See Howto:Creating a Canvas GUI Widget for the main article about this subject.

PUI widgets

1rightarrow.png See pui2canvas for the main article about this subject.

There is a Nasal/Canvas module dynamically "translating" legacy PUI/XML dialogs into Canvas dialogs (at runtime), in fgdata/Nasal/gui/XMLDialog.nas [1]