Labels overwriting without erasing

Maybe this isn’t the best programming practice, but I often use labels on windows to display various status info. The label.text is set in the program, and changes frequently. This has been working fine on a Mac, but I see that when I deploy it on Windows, it works okay when the label is sitting on the window in a group box (see upper right in attached image), but not when it is in a tab panel (see lower left in image). The one in the tab panel doesn’t erase the background when it redraws, and so the text eventually turns into a black blob.


The text “Error Function Calls…” and “Error Function value…” works fine.
the text “Peak Runout…” in the tab panel overwrites without erasing.
Has anyone else encountered this? Is there an easy fix, or a better way to do this?

This is in 2016r3. As I’m writing this, I’m downloading 2016r4.1, but at the rate it’s downloading, it could take several days. :frowning:

When Xojo behaves strangely then the first thing to do is restart the computer (not just Xojo) and see if the problem persists. I’ve seen really weird things (things not working, drawing artefacts) which disappeared after a restart.

Also make sure you call .invalidate on the label.

Good point. I tried this, but it didn’t help.

One thing that I just noticed, is that if you move the mouse pointer anywhere in the window, then it will cause the label background to erase when it updates.

Have you tried Label1.invalidate or Label1.Refresh after changing the text ?

Which brings us back to .invalidate. Time for showing some code.

Actually, self.invalidate may work as well.

Same issue as this:
https://forum.xojo.com/36724-font-troubles-windows-only

One workaround there was to make the label a child of the window, and display it in code when the tabpanel is changed to a sheet that should display it.

I might suggest replacing the label with a call to

.drawstring

Is Transparent = true? See feedback://showreport?report_id=44710

Probably this bug. feedback://showreport?report_id=45856

See more details here

Yes, transparency was on. I turned it off and it fixed the problem. Since there is an open feedback case, I guess I’ll leave it at that, and wait for the case to be resolved.

Regarding the use of invalidate, I hadn’t tried it because the Mac version was working fine, but will keep this in mind if I have more problems.

Thanks everyone for the responses.