What exactly is the rect used for?

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

What exactly is the rect used for?

Post by jalz » Thu Jul 17, 2014 3:32 pm

Hi All,

Just a general query, nothing code specific but a concept to help me understand further. I notice there is a lot of reference to rect, (rectangle) when programming in LiveCode as well as other languages. What is the whole point of the rect, is it to do with screen size or the object size? When I was playing data grids, I noticed the rect used in the code. It seems like its a commonly frequently used command but I don't understand the significance, perhaps I'm just overthinking things as usual.

Sorry for the duh question, just wanted to get the term clear in my head and what it can be potentially used for (I've seen it in printing etc - so is it the viewport of an object/card etc?).

Thanks

Jalz

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

Re: What exactly is the rect used for?

Post by Klaus » Thu Jul 17, 2014 3:44 pm

Hi jalz,
jalz wrote:... perhaps I'm just overthinking things as usual.
yep, sounds like! :D

"The rect" of an object simply describes the (rectangular) area occupied by an LC object on the card and/or monitor!
Nothing mysterious, nothing special, nothing to see here, please pass on... 8)


Best

Klaus

jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

Re: What exactly is the rect used for?

Post by jalz » Thu Jul 17, 2014 3:49 pm

OK - I gotta stop overcomplicating things, just me being daft - :oops:

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

Re: What exactly is the rect used for?

Post by Klaus » Thu Jul 17, 2014 6:28 pm

jalz wrote:... just me being daft - :oops:
Don't worry, others have made a whole career out of this misery:
http://www.youtube.com/watch?v=h5EofwRzit0 :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: What exactly is the rect used for?

Post by dunbarx » Thu Jul 17, 2014 6:31 pm

Don't be daft, do this instead:

Make two buttons and place them anywhere on a new card. Do this in the msg box:

set the left of btn 2 to item 1 of the rect of btn 1.

The possibilities are endless...

Craig Newman

Post Reply