Xojo 2018 and a canvas that won't draw properly in MS Windows

I am not sure if it is even useful posting this because it is a vague problem.

I have a tabbed interface that works on a page panel. When you click a certain tab, it brings you to a canvas control that has certain graphics drawn. In the change event of the page panel, a method is called to update the canvas. On the Mac, it works great, and the graphics is drawn without any flicker or wait time as the tab interface changes.

However, on the windows build using Windows 10, the canvas is not drawn at all after changing the value of the page panel which should trigger the method. If I call this method elsewhere once the page panel is already on this value, it works. I tried all sorts of silly work arounds like using a timer to wait 10 milliseconds after changing the page panel to fire the method. I tried putting all that code in the Pain event of the canvas and using canvas.refresh instead.

What gives?

I’m always amazed how few people bother to check the documentation.

https://documentation.xojo.com/index.php/TabPanel:

“Placing TabPanels within PagePanels (and vice versa) are not officially supported.”

Lazy bumchen!

[quote=385275:@Markus Winter]I’m always amazed how few people bother to check the documentation.

https://documentation.xojo.com/index.php/TabPanel:

“Placing TabPanels within PagePanels (and vice versa) are not officially supported.”

Lazy bumchen![/quote]

I am NOT placing a tabpanel in a PagePanel. I have canvas controls elsewhere outside the page panel that look like tabs.

Then I misunderstood. My apologies.

My feeling is you are running into a z order problem, that the canvas is being drawn beneath the pagePanel. Julien might have a fix for that.

But why do you use separate canvases anyway? Draw your interface to separate pictures, and draw the picture in the one canvas depending on your tab.

What happens if you call Canvas.Invalidate in the PagePanel.Change event?

You refer to calling a method to update your canvas. ALL of the drawing should be initiated in the canvas paint event. Then to update you call canvas.invalidate

Could you put a simple demo project together that shows the problem and I’ll take a look?

I could’ve sworn I tried just using the Paint event in canvas before, but I tried it again and it did the trick. It does not work if you call it in a method outside the canvas … I answered my own question.

Actually, Roger did.

I stand corrected