[PD] Data structures and their clickable area

Roman Haefeli reduzent at gmail.com
Thu Jan 30 00:11:00 CET 2014


On Die, 2014-01-28 at 12:40 +0100, João Pais wrote:
> there might be a complicated and confuse way of doing it - by clicking the  
> scalar, you activate a click message to the drawing window, that clicks in  
> the drawed number. For that you would have to look around the click  
> messages in the pd documents, which I didn't really understood so far.

Can you intercept mouse events done in the canvas? Can you even do it
without externals?

Roman

> > On 01/27/2014 05:35 PM, Roman Haefeli wrote:
> >> Hi
> >>
> >> I'm using a template consisting of a rectangle done with [filledpolygon]
> >> and a number [drawnumber] in it. While mouse clicks anywhere in the area
> >> of the rectangle are detected, it's only possible to change the number
> >> with the keyboard when I exactly click on the number. Is there a way to
> >> make the number catch the keyboard no matter where I click in the
> >> rectangle?
> >
> > That's not possible.  Essentially what you want is to take a click from  
> > one draw command-- [filledpolygon]-- and "map" it or forward it to  
> > another-- [drawnumber].  Scalars don't give you any tools to hook in to  
> > a parent drawing command's widgetbehavior that way.
> >
> >>   Similarly, I'd like to be able to mouse-drag anywhere in the
> >> rectangle in order to change the value of the number.
> >
> > You could probably do it if you use a field variable to define hotspots  
> > on every 6x6 tile of the rectangle.  But you'd also have to constrain  
> > movement of the rectangle by abusing the quanta syntax, something like  
> > (-whatever:whatever)(0:0).  That would presumably constrain the field  
> > variable's screen coordinates so that it doesn't move when you  
> > click-drag it.  Then use the same field variable for your [drawnumber].
> >
> > I'm almost finished with some new drawing instructions for data  
> > structures in Pd-l2ork that implement a subset of the svg spec. I've got  
> > some mouseover/mouseout widgetbehaviors working, but still nothing  
> > particularly sophisticated in terms of mapping mouse/keyboard  
> > interaction to field variables.
> >
> > One possibility is to make the hotspot bbox settable.  Or maybe have a  
> > method to forward widgetbehaviors to another drawing command.
> >
> > -Jonathan
> >
> >>
> >> Any ideas?
> >>
> >> Roman
> >>
> >>
> >>
> >> _______________________________________________
> >> Pd-list at iem.at mailing list
> >> UNSUBSCRIBE and account-management ->  
> >> http://lists.puredata.info/listinfo/pd-list
> >
> >
> > _______________________________________________
> > Pd-list at iem.at mailing list
> > UNSUBSCRIBE and account-management ->  
> > http://lists.puredata.info/listinfo/pd-list
> 
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list





More information about the Pd-list mailing list