Page 1 of 1

getting to grips

Posted: Tue Jan 22, 2013 2:17 pm
by R.Hollis-Graves
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

Re: getting to grips

Posted: Tue Jan 22, 2013 2:24 pm
by Klaus
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

Re: getting to grips

Posted: Tue Jan 22, 2013 2:32 pm
by Dixie
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

Re: getting to grips

Posted: Tue Jan 22, 2013 2:37 pm
by R.Hollis-Graves
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 ?

Re: getting to grips

Posted: Tue Jan 22, 2013 2:45 pm
by Klaus
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

Re: getting to grips

Posted: Tue Jan 22, 2013 2:47 pm
by Klaus
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

Re: getting to grips

Posted: Tue Jan 22, 2013 3:03 pm
by R.Hollis-Graves
Thanks Dixie and Klaus
- sometimes it can be a disadvantage having coded in other IDE's.

Both your helps most appreciated

Best regards
RHG

Re: getting to grips

Posted: Tue Jan 22, 2013 3:32 pm
by Klaus
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