[PD-dev] Hacking numberbox to send value only on mouse up
ix at replic.net
ix at replic.net
Sun Feb 27 13:33:08 CET 2005
On Sun, Feb 27, 2005 at 01:18:33PM +0100, Jan Baumgart wrote:
> Hi Folks!
>
> I'm currently writing an oldschool pattern-list sequencer pd patch, using
> lots of numberboxes and the PDContainer external, eg.
>
> measure quarter tick values
> 1 2 380 12 -234 23 2.5
> ....
>
> everything works fine, except one thing: When changing the time of one
> list entry via mouse movement, the list gets resorted on _every_ motion
> and eventually the entry gets replaced by another one and I end up in a
> complete "timeline" mess,
>
> ---HERE's THE ACTUAL QUESTION---
>
> I'm looking for a way to change numbox or number2`s behaviour to only send
> its value, when the mouse button is released. I'm not familiar with PDs
> communication with the tk-GUI and the numbox-code seems quite confusing to
> me :(. Is there any chance at all, for an external to react on mouse
> _release_ ???
can't help you with the normal numboxes, but with toxy it could be:
#> mynumbox text
bind .- <ButtonRelease-1> {pd [concat .| _cb [.- cget -text] \;]}
bind .- <B1-Motion> {.- configure -text [expr [.- cget -text] + %x]}
or something along those lines..
>
> THX for any ideas on this.
> happy coding,
> jan.
>
>
> --
> Lassen Sie Ihren Gedanken freien Lauf... z.B. per FreeSMS
> GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://iem.at/cgi-bin/mailman/listinfo/pd-dev
More information about the Pd-dev
mailing list