Using a graphic in Datagrid row template

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
rbrucep
Posts: 21
Joined: Thu Jul 05, 2012 4:25 pm

Using a graphic in Datagrid row template

Post by rbrucep » Sun Jun 15, 2014 1:52 am

I'm having trouble with the penColor in a graphic in a Datagrid row template
(LiveCode 6.6.2 Commercial)

In the onFillInData handler, I can set the WIDTH of the graphic with code like

set the width of grc "My_grc" of me to 15

However, this code

set the penColor of grc "My_grc" of me to 100,200,50

Fail silently. Does anyone know if I'm doing something wrong, if this isn't a capability of Datagrid, or I'm perhaps looking at a bug?

Thanks!
Bruce

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Using a graphic in Datagrid row template

Post by bn » Sun Jun 15, 2014 10:13 am

Hi Bruce,

"penColor" is used with paint tools. I.e. when you paint (draw) into a bitmap image.

Apparently you are using a graphic object. You can set the "foregroundColor" of a graphic object to get the effect you are after.

Kind regards
Bernd

rbrucep
Posts: 21
Joined: Thu Jul 05, 2012 4:25 pm

Re: Using a graphic in Datagrid row template

Post by rbrucep » Sun Jun 15, 2014 4:28 pm

Bernd:

Aha! You've put your finger on it!
Actually, I was intending to use a LINE grc, but since I hadn't told LiveCode and was using default rectangle with an invisible line, all my work on the pen was invisible.

Oddly, making the appropriate changes to the graphic (declaring it as style 'Line') now seems to render it invisible, but the code works when I use a rectangle with a visible line.

So I've likely got some other snafu, but haven't investigated; I just wanted to write and say Thanks!

Bruce

rbrucep
Posts: 21
Joined: Thu Jul 05, 2012 4:25 pm

Re: Using a graphic in Datagrid row template

Post by rbrucep » Sun Jun 15, 2014 4:35 pm

The line had no points, hence no visible representation.
So setting the grc to style 'Line' and giving it dimensions and all is well.

Thanks again, Bernd!

Post Reply