App HTML Header

Hector

Unbelievable! Though it seems a roundabout route using three computer languages to change a font and background color, your method worked like a charm. I can not only override Bootstrap (which I have spent an awful lot of time doing over the years), but I can create my own classes and apply them.

You have no idea how many times I’ve asked this question and how many ways. I guess perseverance is the operative methodology here.

FYI, I have uncovered the following caveats thus far. On my Mac M1, using Xojo 2022 Version 1, a CSS class definition using a border will not surround an object. On a button it will surround three sides, on a web list it will border the top and left. Using styles you can border the button just fine, but in the web list (after you subclass the list), the result with the border is the same as when using CSS. Shadow does not evidently work on a list, either via style or CSS.

Whether the transience of the Control ID will become a problem as Greg said, I suspect this is due to the style properties getting their information in advance of knowing the control’s size. I have set the control size through code and turned off the locking, but the results don’t change.

To get a decent border around a list I presume I’ll end up doing what I do for the desktop and just use a canvas control. As Greg mentioned previously, the Web List is evidently descended from the open source Datatable, so it presumably has its own styling rules. I can style buttons and labels all day long, but web lists don’t suffer too many alterations.

Needless to say, you’ve saved me a boatload of time and effort. I have seen similar code back when I was just starting to fool with Xojo web (a few days ago) but it made no sense to me till you added that one line explanation. Then I got it running in four minutes.

Thank you,
fritz

1 Like

Greg

I can see where that would happen, so I’m experimenting with a listbox that I assume would be subject to redraw as it pulls in data and gets resized with the window resize. I can summon the ControlID after a change in data or size. If I see any change during the life of a window, I will let you know.

Thank you,
fritz

Glad it worked :slight_smile:

1 Like

Has anyone submitted a FR to provide a simple way to add css classes to a control? Seems like that would be very convenient. Something like

AddClassName(ParamArray ClassName() as String)
2 Likes

Tim

I can’t see that anybody has (I checked on the issues site). I’ve never filed one before, but I’d be happy to get my feet wet doing so, if you wouldn’t mind my directly copying your syntax. As I’ve spent days and days trying to find something just like it, I think it’s worth adding to the request list.

1 Like

No, but I should.