How to color a "cell"?

Mark Waddingham mark at livecode.com
Thu Jun 23 15:54:55 EDT 2022


IIRC you need to use ‘line’ to set ‘paragraph‘ properties of fields…

Sent from my iPhone

> On 23 Jun 2022, at 19:29, Richard Gaskin via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Craig wrote:
> 
> > Richard wrote:
> >> I had hoped the paragraph-level formatting options introduced in
> >> v5.x would help, but alas as far as I can tell I can only set the
> >> backgroundColor of a run of text, not the full cell.
> >
> > I think this was discussed on the forum a while back. I do not believe
> > you can do what you want without another control overlying the “rect”
> > of the “cell”.
> 
> Thanks. I could get away with setting the backgroundColor of the whole line, but that does the same as setting the backgroundColor of a "cell": it draws the color only beneath the portion of the line that contains text, leaving the rest blank.
> 
> The borderWidth and borderColor paragraph properties work as expected, affecting the full line whether it's filled with text or has no text at all.
> 
> But backgroundColor as a paragraph setting feels broken, as it works the same as setting that property for a chunk rather than for the field.
> 
> From the v5.5.4 Release Notes:
> 
> - The backgroundColor property allows the color of the content area
>  (inside any paragraph border) to be filled (note that strictly
>  speaking this property is not inherited, but the effect is the same
>  as if it was as the background of the field is rendered before the
>  paragraphs are so the background color at the field level will
>  ‘show through’ to the paragraph if the paragraph has no background
>  color).
> 
> - The borderWidth property determines the width of the border to draw
>  around the paragraph.
> 
> Pretty much all the other paragraph-level formatting options work just their their field-level counterparts, but of course limited to the specified paragraph.
> 
> So I'm surprised the backgroundColor was added in such a way that it appears to do nothing we didn't already have with setting backgroundColor of chunks.
> 
> I was hoping I was just using it wrong.
> 
> Here's how I set it in my tests:
> 
>    set the backgroundcolor of paragraph 2 of fld 1 to yellow
> 
> Unless there's a different syntax I should be using, it would appear the paragraph-level implementation of backgroundColor is unfinished, no?
> 
> 
> -- 
> Richard Gaskin
> Fourth World Systems
> Software Design and Development for the Desktop, Mobile, and the Web
> ____________________________________________________________________
> Ambassador at FourthWorld.com                http://www.FourthWorld.com
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list