How to get object's absolute position?

Sep 17, 2007 at 11:27am

How to get object's absolute position?

Hi List,

I know there is Jasch’s amazing [posit] which can get object’s
relative position in a patcher window. But how can I get its absolute
position(refer to screen top let corner)?

thanks,

RIo

#33710
Sep 17, 2007 at 12:20pm

hi. You can use the patcher position (with thispatcher) and add it to your
object position but I guess you better ask a nicer solution to the
javascript thread…

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 170 223 102 9109513 unpack s s i i i i;
#P newex 259 96 27 9109513 t b l;
#P newex 312 167 28 9109513 pack;
#P newex 206 277 116 9109513 vexpr $i1 + $i2;
#P newex 206 246 28 9109513 pack;
#P newex 206 299 57 9109513 prepend set;
#P message 170 178 69 9109513 window getsize;
#P message 206 329 58 9109513;
#P newex 276 143 118 9109513 unpack s s i i i i s;
#P button 82 96 15 0;
#P objectname A;
#P message 259 76 41 9109513 query A;
#P newex 276 120 40 9109513 posit;
#N thispatcher;
#Q end;
#P newobj 170 200 54 9109513 thispatcher;
#P comment 24 96 63 9109513 named A –>;
#P connect 5 3 11 1;
#P connect 11 0 10 1;
#P connect 5 2 11 0;
#P connect 2 0 5 0;
#P connect 12 1 2 0;
#P connect 3 0 12 0;
#P connect 13 3 9 1;
#P connect 8 0 6 0;
#P connect 10 0 8 0;
#P connect 9 0 10 0;
#P connect 13 2 9 0;
#P connect 1 0 13 0;
#P connect 7 0 1 0;
#P connect 12 0 7 0;
#P window clipboard copycount 14;

#112650
Sep 17, 2007 at 1:27pm

It’s good enough,

Thanks !

#112651

You must be logged in to reply to this topic.