Page 1 of 1

Stack resize problem

Posted: Fri Nov 18, 2011 2:39 pm
by Happyrever
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?

Re: Stack resize problem

Posted: Fri Nov 18, 2011 4:29 pm
by Mark
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

Re: Stack resize problem

Posted: Fri Nov 18, 2011 6:41 pm
by jmburnod
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

Re: Stack resize problem

Posted: Fri Nov 18, 2011 6:51 pm
by Mark
Sorry, Jean-Marc, that should be stack.

Mark

Re: Stack resize problem

Posted: Fri Nov 18, 2011 9:09 pm
by bn
Hi Happyrever,

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

Bernd

Re: Stack resize problem

Posted: Fri Nov 18, 2011 10:20 pm
by Happyrever
Thank you for the stack it will show the way nicely.

Re: Stack resize problem

Posted: Fri Nov 18, 2011 11:27 pm
by jmburnod
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

Re: Stack resize problem

Posted: Fri Nov 18, 2011 11:56 pm
by bn
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

Re: Stack resize problem

Posted: Sat Nov 19, 2011 8:41 am
by jmburnod
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