On Mar 17, 2019, at 5:53 PM, pd-dev-request@lists.iem.at wrote:
Date: Sun, 17 Mar 2019 17:53:32 +0100 From: "Christof Ressi" <christof.ressi@gmx.at mailto:christof.ressi@gmx.at> To: pd-dev <pd-dev@lists.iem.at mailto:pd-dev@lists.iem.at> Subject: Re: [PD-dev] Fw: Re: local canvas-only pd_bind Message-ID: trinity-747b5b71-f76b-4152-b9e3-32b84eb46d99-1552841612281@3c-app-gmx-bs56
Content-Type: text/plain; charset=UTF-8
But, no mouseup unfortunately.
on mousedown, the widget could assign itself to a "grab" variable, and a mouseup event sends a message to the object who has the current grab.
Basically yes. I've implemented a similar strategy in a "poor man's UIKit" for my lua environment ala Apple's UIKit: https://github.com/danomatika/loaf-ingredients/tree/master/hui https://github.com/danomatika/loaf-ingredients/tree/master/hui
The lowest (sub)view that received the mouse down becomes the active subview and receives the eventual mouse up, no matter where it may occur. Mouse position is scaled to match the coordinates of the (sub)view.
another question: if we choose to go with a widget, can we just add this functionality to [cnv] ? after all, it can be made invisible by setting the visible width and height to 0.
It might be good to design this in such a way that it can be used within the other UIs and possible externals. Again, UIKit's approach to this is nice in that you only have to think about what';s going on within you're view as mouse events are only propagated down when the mouse is over and interstices with the lowest (sub)view.
In any case, this is getting more complicated that my original intention (simple [mouse] analogy to [key]), however I am familiar with some of the approaches and we could mock up a test proposal. If this can be done in a no-to-complicated manner, it's a win for everyone.
-------- Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/