resize card with minimum width and height

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
jalz
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 340
Joined: Fri Sep 12, 2008 11:04 pm

resize card with minimum width and height

Post by jalz » Thu Feb 26, 2015 8:15 am

Hey Guys,

How would I set the minimum height and width a user can to resize my card? Can I do this stack specific, so if I apply this at the Main stack and will it cascade down, or does it have to be done on each individual card.

Many thanks
Jalz

keram
Posts: 340
Joined: Fri Nov 08, 2013 4:22 am

Re: resize card with minimum width and height

Post by keram » Thu Feb 26, 2015 10:48 am

Set it on the stack.
Using the latest stable version of LC Community 6.7.x on Win 7 Home Premium, 64bit

tjo7777
Posts: 34
Joined: Fri May 02, 2014 9:16 pm

Re: resize card with minimum width and height

Post by tjo7777 » Thu Feb 26, 2015 4:12 pm

Hi Jalz,

I'm pretty much a noob myself, but I think I can answer this question for you.

You can use code like this to set the minimum stack width and height:

Code: Select all

on resizeStack cardWidth, cardHeight
   set the minWidth of this stack to 600
   set the minheight of this stack to 450
end resizeStack
In this example I've done it from inside resizeStack. If the user changes the size of the window this ensures they cannot make it smaller than 600x450. Of course you change the numbers to suit your own needs.

I believe you could also do this from within openStack, but it's probably not necessary if you set the stack properties to the size you like.

Hope this helps,

TJ.

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

Re: resize card with minimum width and height

Post by jalz » Thu Feb 26, 2015 7:53 pm

Thanks Guys :D

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”