wow, kudos for understanding that so quickly !
It's exactly like that: https://wiki.flightgear.org/Howto:Proce ... s#Approach
We do have an API to register new fgcommands that are implemented in Nasal, and that API can also be used to override built-in APIs.
The pui2canvas module used a separate/new fgcommand, not to conflict with the built-in PUI related fgcommands, but could easily override those, too.
Yes, it's all been planned and figured out 7+ years ago - it was just put on the back burner, because of the Qt5 effort - but now it seems that this is being discarded in favor of the Canvas approach.
Thus, with "official" endorsement from James himself, it might make sense to read up on the original concept.
The original idea can be looked up here: https://wiki.flightgear.org/Canvas_widgets
Given that there is now support from the C++ side as well, things are actually easier than before - there really isn't much missing, basically just a handful of widgets: https://wiki.flightgear.org/Canvas_widget_matrix
If in doubt, it might be a good idea to get involved in James's work and maybe use the upcoming hackathon to prototype a few missing widgets - however, the first step might be to review/update our wiki docs to better document how to create such Canvas widgets: https://wiki.flightgear.org/Howto:Creat ... GUI_Widget
I suppose, once that's fixed up, more people could get involved in creating the handful of missing Canvas widgets, so that James could focus on the C++ side.
Again, the hackathon would seem like an ideal opportunity to get rid of PUI that way
Finally, pui2canvas was just meant to be proof-of-concept at the time (it took a few weekends to prototype the parser), James has now been working on a new parser, that's already in $FG_ROOT - so if in doubt, please get involved in his effort.
The pui2canvas article was only kept for future reference (hoping it would never be needed ... but alas )