Automation: a problem involving cow dung

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Automation: a problem involving cow dung

Post by richmond62 » Sat Feb 19, 2022 10:44 am

Having a "morning spat" with someone singing the dubious joys of Python, and both
trying to create a 640 x 480 window with a 300 x 200 RED rectangle in the centre.

Certainly with LiveCode I had no problem whatsoever EXCEPT that what should have been RED came out as COW DUNG:
-
cowDung.jpg
-

Code: Select all

on mouseUp
   create stack "newWindow"
   set the width of stack "newWindow" to 640
   set the height of stack "newWindow" to 480
   set the loc of stack "newWindow" to the screenLoc
   create grc "sexyRect" in card 1 of stack "newWindow"
   set the width of grc "sexyRect" of card 1 of stack "newWindow" to 300
   set the height of grc "sexyRect" of card 1 of stack "newWindow" to 200
   set the loc of grc "sexyRect" of card 1 of stack "newWindow" to 320, 240
   set the backColor of grc "sexyRect" of card 1 of stack "newWindow" to red
   set the opaque of grc "sexyRect" of card 1 of stack "newWindow" to true
end mouseUp
-
Now why would that be?
-
cow.png
cow.png (6.79 KiB) Viewed 2993 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Automation: a problem involving cow dung

Post by richmond62 » Sat Feb 19, 2022 10:51 am

Ah, no more problems in the cow byre:

Code: Select all

set the backColor of grc "sexyRect" of card 1 of stack "newWindow" to 255,38,0
Funny, as the Documentation does state that one can use colour names.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Automation: a problem involving cow dung

Post by richmond62 » Sat Feb 19, 2022 10:57 am

This hearkens back to my Master's degree Thesis from the "University" of Abertay.
-
SShot 2022-02-19 at 11.55.09.png
Attachments
Automat.livecode.zip
(8.29 KiB) Downloaded 118 times
Last edited by richmond62 on Sat Feb 19, 2022 11:10 am, edited 1 time in total.

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Automation: a problem involving cow dung

Post by Klaus » Sat Feb 19, 2022 11:02 am

Hi Richmond,

this is strange, I used exactly your script and did not get "what is brown and sounds like a bell"!? :-D
LC 9.6.6 macOS 12.2.1

Best

Klaus
red_not_brown.jpg

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10098
Joined: Fri Feb 19, 2010 10:17 am

Re: Automation: a problem involving cow dung

Post by richmond62 » Sat Feb 19, 2022 11:12 am

I got cow dung the first timewith 9.6.3 Community,

and proper red with 9.6.6.

Then: went back and opened the stack in 9.6.3 and got red.

You tell me???

MacOS 12.3 beta 2

Klaus
Posts: 14193
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Automation: a problem involving cow dung

Post by Klaus » Sat Feb 19, 2022 11:32 am

Funky, funky! 8)

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10045
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Automation: a problem involving cow dung

Post by FourthWorld » Sat Feb 19, 2022 3:47 pm

Was the first attempt in a fresh session? I wonder if perhaps an ink effect applied to the templateGraphic may have been in effect, or something of that sort.

If the problem recurs consider reviewing the properties of the templateGraphic.

As for "the dubious joys of Python":

While I prefer JavaScript among non-LC languages for the ubiquity of its engine (being preinstalled on every GUI device sold is an availability vastly beyond the dreams of even HyperCard's heyday), Python is measurably the world's most popular language: It topped the TIOBE List some time ago and has remained solidly there since.

If there's anything I learned about software advocacy from the SuperCard vs Director years of the mid-90s (or even SuperCard vs HyperCard of the years prior) it's that simply focusing on those areas where my personal favorite tool is demonstrably superior teaches me nothing about why so relatively few choose it over the mindshare leader.

These days, before I call out the weaknesses of a choice others have made, I first try to call in with questions of the perceived benefits of that choice.

Software evangelism isn't a blunt instrument. Jacque can attest to the ineffectiveness of a HyperCard stack I'd distributed in HC circles titled "Why SuperCard?". It turns out that the art of persuasion is a scalpel, not a bludgeon. ;)

Python is the leading choice for a reason. Its journey is, like all others, unique; its story cannot be LiveCode's.

But there may be concerns and interests among Python's many fans that LiveCode might be able to support more gracefully.

If only 0.1% of Python devs chose to add LC to their toolkits, LC would see a growth previously unmatched.

Python's role in developers' workflows is worth learning about.

The easiest way to learn is just asking, listening without judgement or rebuttal, but with an earnest desire to learn.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Post Reply