mouseLoc OS X strangeness

Malte Brill malte.brill at t-online.de
Wed Jun 18 05:04:00 EDT 2003


David Beck wrote:

[snip]
In Mac OS X, however, the button locations still have origin of (0,21), but
the mouseLoc function has an origin of (0,13), meaning that when the
mouseLoc function is called with the mouse over the top left pixel of the
stack window, the function returns "0,13". This threw me off for a while but
I eventually I sorted it out and rewrote up my scripts accordingly. However,
I have now distributed my stack and am getting reports from end users that
they are having problems which lead me to believe that only SOMETIMES the
mouseLoc function origin is (0,13) in OS X, and sometimes it is (0,21). What
gives with this? What is the rhyme and reason here? Is there a work around?
[/snip]

I came across a positioning issue (all the objects on the card containing
the menubar group have moved when setting it as menubar)
Well I guess this is due to the used system font. (Just a guess, though)

You might try this:
on mouseUp
  put the height of grp "menubar 1" into a
  put the height of btn "file" into b
  put the effective textheight of btn "file" into c
  put a-b-c+a into correct
  put correct
end mouseUp

correct then holds the value you need to caculate the correct origin.

Could you be so nice and hack these lines in a test stack, send it to your
bugreporters and post the values they get? Would be very helpful for me.

Thanks,

Malte






More information about the use-livecode mailing list