windowShape revisited

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
richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

windowShape revisited

Post by richmond62 » Sat Oct 22, 2022 10:12 am

So, I have a stack with a graphic line on it:
-
SShot 2022-10-22 at 12.08.29.png
-
and the button contains this code:

Code: Select all

on mouseUp
   import snapshot from grc "myLine"
   if exists(img "shadow") then
      delete img "shadow"
   end if
   set the name of the last control to "shadow"
   set the layer of img "shadow" to 1
   set the loc of img "shadow" to the loc of grc "myLine"
   set the windowShape of this stack to the ID of img "shadow"
end mouseUp
which is fairly pedestrian and, apparently, straightforward,

BUT the end result is this:
-
SShot 2022-10-22 at 12.10.52.png
-
which it should not be; the alignment being, as we say in Scotland, "agley" or "aff".
Attachments
playRoom.livecode.zip
Stack.
(4.61 KiB) Downloaded 43 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: windowShape revisited

Post by richmond62 » Sat Oct 22, 2022 4:38 pm

Code: Select all

on mouseUp
   import snapshot from grc "myLine"
   if exists(img "shadow") then
      delete img "shadow"
   end if
   set the name of the last control to "shadow"
   set the layer of img "shadow" to 1
   set the loc of img "shadow" to the loc of grc "myLine"
   --- additions
   set the top of grc "myLine" to the top of card "c1"
   set the left of grc "myLine" to the left of card "c1"
   ----
   set the windowShape of this stack to the ID of img "shadow"
end mouseUp
Well, here we go again, I end up answering my own question as really cannot wait . . .
-
SShot 2022-10-22 at 18.35.35.png
-
And that is NOT documented.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9837
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: windowShape revisited

Post by FourthWorld » Sat Oct 22, 2022 7:22 pm

"that"?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: windowShape revisited

Post by richmond62 » Sat Oct 22, 2022 8:05 pm

THAT the topleft of the image that is used as the reference for the windowShape
must be 0,0; the topleft of the card of the stack.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: windowShape revisited

Post by richmond62 » Sun Oct 23, 2022 10:43 am

ACTUALLY 'THAT' is what prevents one from developing some sort of 'squiggle board' in LiveCode
where an end-user can use the brushTool to draw on top of their desktop: because any masking would
shift their squiggles top-and-left in a disconcerting way UNLESS the whole thing was contained
inwith a FRAME.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: windowShape revisited

Post by richmond62 » Sun Oct 23, 2022 11:07 am

SShot 2022-10-23 at 13.04.54.jpg
-
Getting 'there' [wherever 'there' is 8) ].

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: windowShape revisited

Post by richmond62 » Mon Oct 24, 2022 7:56 am

Screen Shot 2022-10-24 at 9.59.21 AM.png
-
HOWEVER . . . with this script in the octagon:

Code: Select all

on mouseEnter
   choose browse tool
end mouseEnter

on mouseLeave
   choose brush tool
end mouseLeave
the mouseLeave code works,

but

the mouseEnter does NOT.

What should happen is something like this:
-
Screen Shot 2022-10-24 at 9.59.52 AM.png

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9387
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: windowShape revisited

Post by richmond62 » Mon Oct 24, 2022 11:28 am

Presumably the reason for this is because choose brush tool sets up an image at a higher
layer than the object containing the mouseEnter code.

There seems no obvious way to circumvent this.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”