Mouse position reported wrongly

View: New views
4 Messages — Rating Filter:   Alert me  

Mouse position reported wrongly

by Jasper Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I have found a problem on my ppc (G4) Mac Mini, which runs OSX 10.3.9.  
It draws canvas graphics in the wrong position after the window  
containing the canvas has been moved. Here is a little script that  
will show the problem:

pack [canvas .c]
bind .c <Button-1> {.c create rect %x %y %x %y -width 10}

Start Wish and run this script, and you get a little square where you  
click the mouse. But then move the wish window, and the square comes  
up away from the mouse position. In fact it appears that the  
coordinates are relative to the top left of the screen rather than the  
window, i.e., they are what %X and %Y should be.

This problem happens with ActiveTcl 8.4.19, and I also have it with a  
version of 8.4.17 I built from the CVS some time before its release.  
The problem does not happen with TclTk 8.4.14 or earlier. Also it  
doesn't occur on my Intel Macbook (OSX 10.5.2).

Clues anyone?
        --Jasper


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: Mouse position reported wrongly

by Jasper Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Heads up...the same thing happens with ActiveTcl 8.5.2! Will try some  
other platforms.
        --Jasper

On 21 May 2008, at 19:16, Jasper Taylor wrote:

> I have found a problem on my ppc (G4) Mac Mini, which runs OSX 10.3.9.
> It draws canvas graphics in the wrong position after the window
> containing the canvas has been moved. Here is a little script that
> will show the problem:
>
> pack [canvas .c]
> bind .c <Button-1> {.c create rect %x %y %x %y -width 10}
>
> Start Wish and run this script, and you get a little square where you
> click the mouse. But then move the wish window, and the square comes
> up away from the mouse position. In fact it appears that the
> coordinates are relative to the top left of the screen rather than the
> window, i.e., they are what %X and %Y should be.
>
> This problem happens with ActiveTcl 8.4.19, and I also have it with a
> version of 8.4.17 I built from the CVS some time before its release.
> The problem does not happen with TclTk 8.4.14 or earlier. Also it
> doesn't occur on my Intel Macbook (OSX 10.5.2).
>
> Clues anyone?
> --Jasper
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Tcl-mac mailing list
> tcl-mac@...
> https://lists.sourceforge.net/lists/listinfo/tcl-mac


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: Mouse position reported wrongly

by Mats Bengtsson-5 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I've done some experiments on my two Macs both with home built 8.5.2:

Intel MacBook 10.5.2:  I don't see any problems here
PPC PowerBook 10.3.9: I see problems as you describe. Also, rects are
not compltely filled.

QuickDraw is gone for pure drawings so that can't be the problem.
Could it be something with the new setup of the GraphicsContext:
TkMacOSXSetupDrawingContext() ?
This function is very difficult to follow. Or could it be something with the
extra double buffering now gone?

Mats

On Thu, May 22, 2008 at 5:24 PM, Jasper Taylor <jasper@...> wrote:

> Heads up...the same thing happens with ActiveTcl 8.5.2! Will try some
> other platforms.
>        --Jasper
>
> On 21 May 2008, at 19:16, Jasper Taylor wrote:
>
>> I have found a problem on my ppc (G4) Mac Mini, which runs OSX 10.3.9.
>> It draws canvas graphics in the wrong position after the window
>> containing the canvas has been moved. Here is a little script that
>> will show the problem:
>>
>> pack [canvas .c]
>> bind .c <Button-1> {.c create rect %x %y %x %y -width 10}
>>
>> Start Wish and run this script, and you get a little square where you
>> click the mouse. But then move the wish window, and the square comes
>> up away from the mouse position. In fact it appears that the
>> coordinates are relative to the top left of the screen rather than the
>> window, i.e., they are what %X and %Y should be.
>>
>> This problem happens with ActiveTcl 8.4.19, and I also have it with a
>> version of 8.4.17 I built from the CVS some time before its release.
>> The problem does not happen with TclTk 8.4.14 or earlier. Also it
>> doesn't occur on my Intel Macbook (OSX 10.5.2).
>>
>> Clues anyone?
>>       --Jasper
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> Tcl-mac mailing list
>> tcl-mac@...
>> https://lists.sourceforge.net/lists/listinfo/tcl-mac
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Tcl-mac mailing list
> tcl-mac@...
> https://lists.sourceforge.net/lists/listinfo/tcl-mac
>

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac

Re: Mouse position reported wrongly

by Jasper Taylor :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think the problem with the positions is caused by something in the
interaction with the window manager, because if you type
wm geometry .
after moving the window, it gives its top-left coordinates as 0,-22 wherever
it is on the screen. Interestingly, correct behaviour can be restored after
moving the window, by maximizing then de-maximizing it.
I suspect the incomplete filling is a separate bug!
        --Jasper

On Friday 23 May 2008 07:11:27 am Mats Bengtsson wrote:

> I've done some experiments on my two Macs both with home built 8.5.2:
>
> Intel MacBook 10.5.2:  I don't see any problems here
> PPC PowerBook 10.3.9: I see problems as you describe. Also, rects are
> not compltely filled.
>
> QuickDraw is gone for pure drawings so that can't be the problem.
> Could it be something with the new setup of the GraphicsContext:
> TkMacOSXSetupDrawingContext() ?
> This function is very difficult to follow. Or could it be something with
> the extra double buffering now gone?
>
> Mats
>
> On Thu, May 22, 2008 at 5:24 PM, Jasper Taylor <jasper@...>
wrote:

> > Heads up...the same thing happens with ActiveTcl 8.5.2! Will try some
> > other platforms.
> >        --Jasper
> >
> > On 21 May 2008, at 19:16, Jasper Taylor wrote:
> >> I have found a problem on my ppc (G4) Mac Mini, which runs OSX 10.3.9.
> >> It draws canvas graphics in the wrong position after the window
> >> containing the canvas has been moved. Here is a little script that
> >> will show the problem:
> >>
> >> pack [canvas .c]
> >> bind .c <Button-1> {.c create rect %x %y %x %y -width 10}
> >>
> >> Start Wish and run this script, and you get a little square where you
> >> click the mouse. But then move the wish window, and the square comes
> >> up away from the mouse position. In fact it appears that the
> >> coordinates are relative to the top left of the screen rather than the
> >> window, i.e., they are what %X and %Y should be.
> >>
> >> This problem happens with ActiveTcl 8.4.19, and I also have it with a
> >> version of 8.4.17 I built from the CVS some time before its release.
> >> The problem does not happen with TclTk 8.4.14 or earlier. Also it
> >> doesn't occur on my Intel Macbook (OSX 10.5.2).
> >>
> >> Clues anyone?
> >>       --Jasper
> >>
> >>
> >> ------------------------------------------------------------------------
> >>- This SF.net email is sponsored by: Microsoft
> >> Defy all challenges. Microsoft(R) Visual Studio 2008.
> >> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> >> _______________________________________________
> >> Tcl-mac mailing list
> >> tcl-mac@...
> >> https://lists.sourceforge.net/lists/listinfo/tcl-mac
> >
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Tcl-mac mailing list
> > tcl-mac@...
> > https://lists.sourceforge.net/lists/listinfo/tcl-mac
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Tcl-mac mailing list
> tcl-mac@...
> https://lists.sourceforge.net/lists/listinfo/tcl-mac



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Tcl-mac mailing list
tcl-mac@...
https://lists.sourceforge.net/lists/listinfo/tcl-mac
LightInTheBox - Buy quality products at wholesale price