windowShape On the Fly

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
nlexa
Posts: 26
Joined: Fri Aug 05, 2011 2:34 am

windowShape On the Fly

Post by nlexa » Wed Nov 20, 2013 1:06 am

Dear reader,

I have attached a simple stack.
You click the button and you should get a pink rectangle with rounded corners.
If you click the rectangle it disappears.
You can do this again and again. I have randomized the height of the pink rectangle to show that it is in fact changing with each click of the button.

The idea is to have a custom shaped substack - like a speech bubble or perhaps a fly out menu, or whatever you might like a custom shaped substack for - that can change its shape dynamically.

I wanted to run this past someone else before I log this as a bug.
WTF.jpg
substackshapetest.zip
(2.02 KiB) Downloaded 261 times

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

Re: windowShape On the Fly

Post by bn » Wed Nov 20, 2013 1:40 am

Hi nlexia,

on windows you have to set the dimensions of the stack to the dimensions of the windowShape.

I guess WTF is the width of the stack that is not changed. Try to set the width to the width of the image and see if WTF is gone.

Kind regards
Bernd

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

Re: windowShape On the Fly

Post by bn » Wed Nov 20, 2013 1:46 am

Hi nlexia,

like this in script of substack

Code: Select all

 # position the image
   put the short id of the target into tNewImageID
   set the top of image id tNewImageID to 0
   set the left of image id tNewImageID to 0
   set the width of this stack to the width of image id tNewImageID
Kind regards
Bernd

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

Re: windowShape On the Fly

Post by bn » Wed Nov 20, 2013 2:29 am

Hi nlexa,

just noticed that I must have had a severe case of dyslexia when I addressed you as "nlexia"

Sorry about that.

Kind regards
Bernd

nlexa
Posts: 26
Joined: Fri Aug 05, 2011 2:34 am

Re: windowShape On the Fly

Post by nlexa » Wed Nov 20, 2013 2:33 am

Yes I'm pretty sure that has sorted it. Thanks very much Bernd :)

Post Reply