getting to grips

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
R.Hollis-Graves
Posts: 3
Joined: Tue Jan 22, 2013 1:36 pm

getting to grips

Post by R.Hollis-Graves » Tue Jan 22, 2013 2:17 pm

I am new to Livecode, coming from a Delphi and RealBasic background. I know this may seem a silly question but; Realbasic allows one to paste a textbox onto a window, which when dragged and expanded with the mouse, can if wished, expand the textbox along with it. Is there any way that this can be done with live code? There does not seem to be any controls in the inspector that allow one to attach the textbox corners to the main stack as one would in Delphi or RB.

many thanks in advance
Best regards

RHG

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

Re: getting to grips

Post by Klaus » Tue Jan 22, 2013 2:24 pm

HI RHG,

1. welcome to the forum! :D
2. No exact idea what you are talking about, but it might be a good idea to check these stacks
to get a "feel" for the whole language and its concepts:
http://www.runrev.com/developers/lesson ... nferences/


Best

Klaus

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: getting to grips

Post by Dixie » Tue Jan 22, 2013 2:32 pm

Hi...

place a fld on a card and put the following into either the card or stack script... This will make the text fld the size of the card and maintain its size when the stack is resized.

Code: Select all

on resizeStack
   set the rect of fld 1 to the rect of this card
   set the topLeft of fld 1 to the topLeft of this card
end resizeStack
be well

Dixie

R.Hollis-Graves
Posts: 3
Joined: Tue Jan 22, 2013 1:36 pm

Re: getting to grips

Post by R.Hollis-Graves » Tue Jan 22, 2013 2:37 pm

Hi Klaus,

thanks for replying - what I was trying to say is that when I drag a textbox onto a new stack and I make the stack larger by dragging the bottom corner, can the text box be expanded along with it so that I can present more text, rather than scrolling the text box ?

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

Re: getting to grips

Post by Klaus » Tue Jan 22, 2013 2:45 pm

Hi RGH,

ah, yes, after Dixies reply, I finally get it :D
Yes, this can (and needs to be) scripted, see Dixies solution!

As you will see, there are not very much "automatisms" in Livecode like in other IDEs,
but everything can (more or less) easily be scripted, the complete IDE is written in Livecode! 8)


Best

Klaus

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

Re: getting to grips

Post by Klaus » Tue Jan 22, 2013 2:47 pm

Hint:

Code: Select all

on resizeStack
   set the rect of fld 1 to the rect of this card
   ##  set the topLeft of fld 1 to the topLeft of this card
   ## Not neccessary!
   ## This will automaticaly happen in line 1 of this script! ;-)
end resizeStack
Best

Klaus

R.Hollis-Graves
Posts: 3
Joined: Tue Jan 22, 2013 1:36 pm

Re: getting to grips

Post by R.Hollis-Graves » Tue Jan 22, 2013 3:03 pm

Thanks Dixie and Klaus
- sometimes it can be a disadvantage having coded in other IDE's.

Both your helps most appreciated

Best regards
RHG

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

Re: getting to grips

Post by Klaus » Tue Jan 22, 2013 3:32 pm

Hi RGH,
R.Hollis-Graves wrote:...
- sometimes it can be a disadvantage having coded in other IDE's...
yep, better forget about this fact when using Livecode! :D


Best

Klaus

Post Reply