Board index FlightGear Development Canvas

Why is my plugin's canvas widget showing as a white box ?  Topic is solved

Canvas is FlightGear's new fully scriptable 2D drawing system that will allow you to easily create new instruments, HUDs and even GUI dialogs and custom GUI widgets, without having to write C++ code and without having to rebuild FlightGear.

Re: Why is my plugin's canvas widget showing as a white box

Postby TheEagle » Thu Jan 27, 2022 6:42 pm

To this day I wasn't able to resolve this problem (which is the main reason for me not continuing the development of this plugin), but I noticed that all the Canvas notifications (such as the one you get when changing mouse mode normal -> flight controls -> view controls) are showing as white boxes on Git next. With a nightly AppImage form June I do not have this problem except on the notification of my addon. Also I don't know if I mentioned it, but I'm using a canvas.PropertyElement as parent for the notification class - are there any known bugs with that ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Why is my plugin's canvas widget showing as a white box

Postby TheEagle » Thu Jan 27, 2022 11:58 pm

Looks like it's not a problem of my addon … I added this to my menubar:
Code: Select all
         <item>
            <label>Debug trigger popup</label>
            <binding>
               <command>nasal</command>
               <script>
                  logprint(LOG_ALERT, "Showing landing notification");
                  
                  landingNotification = canvas.ErrorNotification.new();
                  landingNotification._createCanvas();
                  landingNotification._updateBounds();
                  landingNotification.show(0);
               </script>
            </binding>
         </item>


Well, I let you guess - I got a white empty box !! So the bug must be somewhere inside the ErrorNotification (the LandingNotification is basically an ErrorNotification with a few names and text changed, code-wise) !
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Why is my plugin's canvas widget showing as a white box

Postby TheEagle » Fri Jan 28, 2022 3:24 pm

Gets weirder and weirder … If I load up FG (without any addons !) and execute this in the Nasal console:
Code: Select all
   var tooltip = canvas.Tooltip.new([300, 100]);
   tooltip.createCanvas();
   tooltip.setPosition(200, 200);
   tooltip.setLabel("Hi !");
   tooltip.show();

I get no tooltip at all. But, when I pause the sim after that, I get a "Hi !" on screen instead of the "Simulation paused" !!! So something definitely is getting mixed up here, and it would be great if someone with more insight in the Canvas system could look into this (which doesn't even need my addon as the above code is enough to trigger this behaviour). My addon's canvas staying white is simply due to the same mixup - because that actually also shows up instead of the paused tooltip when I create a LandingNotification.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: Why is my plugin's canvas widget showing as a white box   

Postby TheEagle » Fri Jan 28, 2022 4:28 pm

Hmm. I just got myself a copy of an old backup of my addon (the version which I was using at the time I started this thread), and the popup showed normally. Only after plugin reload it showed as a white box, which I solved by removing a condition which prevented the canvas from getting deleted properly. Looks like while trying to solve the white box after plugin reload, I broke it completely … :mrgreen: Now I just got to find the difference between the two versions … :roll:
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3413
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Previous

Return to Canvas

Who is online

Users browsing this forum: No registered users and 7 guests