WebListBoxStyleRenderer.Bold = False doesn't work?

I have a weblistbox where the user can select any given row and assign it a “type”. I am using a WebListBoxStyleRenderer to style the row with a particular foreground color / background color / bold combination depending on the type.

The user can change the row type any number of times, and the newly assigned style works fine except setting Bold = False doesn’t seem to do anything. That is, if the previous style was bold, and the new style isn’t, the text remains bold. I also noticed that if I don’t explicitly assign a background color in a style, then the previous style’s background color remains.

Does this mean that every time a new style is applied, it just stacks on top of the previous styles?

Also, as an aside, is there any way to clear a renderer after it’s been applied? I have tried setting it to Nil, but that doesn’t seem to do anything.

I am using 2025r2.1

Can you share a small sample project? You can zip it and upload here.
I remember some fixes for r3 but not sure if that will fix your problem.
Maybe you can test that version (or r3.1) and see if that helps.

Here’s a sample project that demonstrates the issue (on 2025r2.1 anyways).

WebListBoxStyleRenderer Test.zip (9.1 KB)

Turns out setting a CellRenderer to Nil pops an exception, so is there any way to clear a renderer? or do I need to define a “no-style” style and apply that instead?

Wouldn’t setting it to a plain text value be your “no style”?

.CellText = "Text Value?"

You will need to create an Issue with that example as it looks like WebStyle gets used from other styles and Bold is not removed with False.

I think it should be, here it changes the text color but keeps the background color/bold from previous style change.

I just created the issue: https://tracker.xojo.com/xojoinc/xojo/-/issues/80815

2 Likes