On Fri, 24 Sep 1999, David C. Tremmel wrote:
> I'm getting different behavior between Mac & Windows (big surprise) in one
> of my scripts, and am wondering if there is anything I can do about it.
> Basically I have a handler in a field script that allows the user to move
> the field by clicking & holding the mouse down on the field. While they
> are doing this, they can alter the appearance of the markers for a graphic
> by hitting the shift key (they can toggle through a set of four different
> types of markers). This works fine on the Mac, but in Windows it only
> responds the first time the shift key is pressed - so you can only change
> the marker type once. Is this an unavoidable problem with how Windows
> deals with these events? Here's the script:
>
> on mouseDown
> wait 10 ticks #checking to make sure it wasn't just a click
> if the mouse is down then
> put "Root " & (word 2 of the short name of me) into tRtGraphicN
> set the markerDrawn of graphic tRtGraphicN to true #show markers
> put 1 into tShiftFlag
> repeat until the mouse is up
> set the loc of me to the mouseLoc
> if the shiftkey is down then
> if tShiftFlag = 1 then
> get toggleArrows(tRtGraphicN)
> put 0 into tShiftFlag
> end if
> else put 1 into tShiftFlag
> end repeat
> set the markerDrawn of graphic tRtGraphicN to false
> end if
> end mouseDown
>
> Thanks in advance for any advice...
A slightly altered version of this works fine here. If you're not
using 2.2.5, please try that as there were some problems with "the
Xkey" functions resembling this fixed in that release.
Also, and I'm sure I sound like a broken record here, "repeat until
<event>" is not the best way to do things like this. Use the
mouseMove message instead. Response will be much better, and load on
the system much lower. See the graph-node-dragging example in the
Examples stack for details.
Regards,
Scott
> Dave Tremmel
>
>
********************************************************
Scott Raney [EMAIL PROTECTED] http://www.metacard.com
MetaCard: You know, there's an easier way to do that...