Page 1 of 1

windowShape revisited

Posted: Sat Oct 22, 2022 10:12 am
by richmond62
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".

Re: windowShape revisited

Posted: Sat Oct 22, 2022 4:38 pm
by richmond62

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.

Re: windowShape revisited

Posted: Sat Oct 22, 2022 7:22 pm
by FourthWorld
"that"?

Re: windowShape revisited

Posted: Sat Oct 22, 2022 8:05 pm
by richmond62
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.

Re: windowShape revisited

Posted: Sun Oct 23, 2022 10:43 am
by richmond62
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.

Re: windowShape revisited

Posted: Sun Oct 23, 2022 11:07 am
by richmond62
SShot 2022-10-23 at 13.04.54.jpg
-
Getting 'there' [wherever 'there' is 8) ].

Re: windowShape revisited

Posted: Mon Oct 24, 2022 7:56 am
by richmond62
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

Re: windowShape revisited

Posted: Mon Oct 24, 2022 11:28 am
by richmond62
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.