Page 1 of 1

Automation: a problem involving cow dung

Posted: Sat Feb 19, 2022 10:44 am
by richmond62
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 2999 times

Re: Automation: a problem involving cow dung

Posted: Sat Feb 19, 2022 10:51 am
by richmond62
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.

Re: Automation: a problem involving cow dung

Posted: Sat Feb 19, 2022 10:57 am
by richmond62
This hearkens back to my Master's degree Thesis from the "University" of Abertay.
-
SShot 2022-02-19 at 11.55.09.png

Re: Automation: a problem involving cow dung

Posted: Sat Feb 19, 2022 11:02 am
by Klaus
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

Re: Automation: a problem involving cow dung

Posted: Sat Feb 19, 2022 11:12 am
by richmond62
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

Re: Automation: a problem involving cow dung

Posted: Sat Feb 19, 2022 11:32 am
by Klaus
Funky, funky! 8)

Re: Automation: a problem involving cow dung

Posted: Sat Feb 19, 2022 3:47 pm
by FourthWorld
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.