Hello,
Apologies in advance, bit new to Tcl/Tk, but I'm trying to get the pointer coordinates of the mouse for an external (yes, Cyclone) via Tcl for both the currently active patcher window and the window in which the external object class was instantiated. The latter sounds trickier and I haven't got there yet, but for the former I'm trying [winfo pointerx $::focused_window] and it seems to just be spitting out screen coords. I've tested out [winfo rootx $::focused_window] and that seems to be sptting the proper top-left coords of the focused window so what am I doing wrong? I suppose if nothing else works, I can just subtract the rootx/y values from the screen values I'm getting and clip them to the window's dimensions. If it helps, I'm testing in Ubuntu. Thanks in advance!
Derek
On 12/09/2016 06:24 AM, Derek Kwan wrote:
Hello,
external object class was instantiated. The latter sounds trickier and I haven't got there yet, but for the former I'm trying [winfo pointerx $::focused_window]
check out iemgut's [canvasreceive]. check out the pdtk_canvas_motion{} func, which does all the messaging of mouse-pointer coords from gui to core.
gfmasrd IOhannes
On 12/09/2016 06:24 AM, Derek Kwan wrote:
Hello,
external object class was instantiated. The latter sounds trickier and I haven't got there yet, but for the former I'm trying [winfo pointerx $::focused_window]
check out iemgut's [canvasreceive]. check out the pdtk_canvas_motion{} func, which does all the messaging of mouse-pointer coords from gui to core.
gfmasrd IOhannes
Thanks! I'm looking over [canvasreceive]'s code right now. I'm curious, what's the point of the clock member of the proxy? I notice that basically its only job is to call the proxy's free method when the clock's delay gets set to 0 via the parent's free method. Are there issues with freeing the proxy directly with the parent's free method?
Derek
On 12/10/2016 06:34 AM, Derek Kwan wrote:
Are there issues with freeing the proxy directly with the parent's free method?
well, otherwise it will crash when you send a "clear" message to the canvas (which will be received by [receivecanvas] that was just deleted). the entire receiver-proxy is a workaround to allow elements to be removed from the linked list of receivers while it is being executed.
gfmdsar IOhannes