Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

event/offset relative to screen-face ?

 [1/4] from: arolls::idatam::com::au at: 23-Nov-2001 18:25

Does anyone know how to get the mouse position (or other event/offset) relative to the screen-face (that is the top-level window which represents the os desktop)? I tried modifying system/view/screen-face/feel to report event/offset, but it appears that all windows that I open still have event/offset relative to their top/left corner. Anton.

 [2/4] from: james:mustard at: 23-Nov-2001 20:56

recurse-offset: func [face /local o][ ;this recursively appends offset values o: face/offset if not none? face/parent-face [o: o + recurse-offset face/parent-face] o ]

 [3/4] from: arolls:idatam:au at: 26-Nov-2001 17:05

I want to get the mouse position directly, because... I'll explain. I am clicking in a window and dragging it to move it (with my own code, not using the os-supplied title bar). However the events come too fast for the refresh (perhaps the hardware face movement trick will improve that). Anyway, the event/offset is measured relative to the window, but I am moving the window, and the window hasn't finished updating since the last event, so some event/offsets are incorrect. This results in a window that reacts kind of wildly, like riding a bucking bronco. I was thinking of using a lock-out mechanism while waiting for the window to finish updating, as I used in a realtime resize program, ( but I haven't figured out a way yet. Anyone got any clues? That's not a bad bit of program there, though. :) Anton.

 [4/4] from: max:quazart at: 26-Nov-2001 8:29

The custom window manager I built a while ago (which I sent with the timeline example a while back) handles all events and does not loose track of the pointer with regards to the window. BUT it does lag behind the mouse when moving slowly... so, My solution, is to do a to-image of the entire ui in the down event of the engage func. replace the pane of the window with one function which tracks NOTHING else than the mouse movement and when the 'up is called, just put the panes back before calling show on the window. I have not tried this, but combined with the recently discovered move optimisation... this should make the loop much quicker. HTH -MAx