Stack resize problem

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
Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Stack resize problem

Post by Happyrever » Fri Nov 18, 2011 2:39 pm

I have a stack with the width divided into two portions. The laft is a narrow verticle column of controls and the right is a wide picture area.
I want to reduce the width of the stack so the controls portion is chopped off, leaving the right hand end only.
I have tried setting the width and height and location to the necessary size, but this just chops off the right hand end.
I have added a suitable width to the first element of the stack location, but again, this just chops of the right side and shifts the stack right.

Any ideas how to move the left edge towards the right so only the rightmost part of the full display is visible?

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Stack resize problem

Post by Mark » Fri Nov 18, 2011 4:29 pm

Hi,

Group all controls, set the left of the group to -100 or whatever is convenient, and set the rect of the card to the current rect subtracting 100 from item 3.

Kind regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Stack resize problem

Post by jmburnod » Fri Nov 18, 2011 6:41 pm

Hi Mark,
set the rect of the card to the current rect subtracting 100 from item 3
I'am confused. It is possible to set the rect of a cd ? :?

Best regards

Jean-marc
https://alternatic.ch

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: Stack resize problem

Post by Mark » Fri Nov 18, 2011 6:51 pm

Sorry, Jean-Marc, that should be stack.

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Stack resize problem

Post by bn » Fri Nov 18, 2011 9:09 pm

Hi Happyrever,

here is a little stack for the stack resize problem.
toggleWidthOfStack.livecode.zip
(1.55 KiB) Downloaded 245 times
Kind regards

Bernd

Happyrever
Posts: 55
Joined: Sat Sep 10, 2011 12:22 pm

Re: Stack resize problem

Post by Happyrever » Fri Nov 18, 2011 10:20 pm

Thank you for the stack it will show the way nicely.

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Stack resize problem

Post by jmburnod » Fri Nov 18, 2011 11:27 pm

Hi Bernd,

toggleWidthOfStack is nice

Code: Select all

repeat with i = 1 to tIRedWidth step 5
I dont know "step" (dictionary and release notes also)
Where come it from ? :shock:

Best from Geneva

Jean-Marc
https://alternatic.ch

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Stack resize problem

Post by bn » Fri Nov 18, 2011 11:56 pm

Hi Jean-Marc,

thank you.
I dont know "step" (dictionary and release notes also)
Where come it from ?
I use it regularly, It is part of the "repeat with" options. When you mentioned it that it is not in the dictionary I looked it up. It is there but it is hard to find/understand:

from the dictionary:
* with counter = startValue [to | down to] endValue [step increment]....

If you specify an increment, the increment is added to the counter each time through the loop, rather than the counter being increased by 1. (The increment is not treated as an absolute value: if you're using the down to form, the increment must be negative.)
and
The following example loops backwards through a set of lines. The counter myLine is 20 during the first iteration, 18 during the second, and so on:

repeat with myLine = 20 down to 1 step -2
put myLine
end repeat
it is really not very clear how to use it.

But you can use step if you want to omit some intermediate steps. As in the example. It is actually quite handy at times.

Kind regards

Bernd

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Stack resize problem

Post by jmburnod » Sat Nov 19, 2011 8:41 am

Hi Bernd,

Thank for explanation about step
It is there but it is hard to find/understand
Yes. Your stack is the best explanation (change the value of step and see what happend)

Best regards

Jean-Marc
https://alternatic.ch

Post Reply