[PD] control a value with number box and slider at the same time

IOhannes m zmölnig zmoelnig at iem.at
Fri Aug 14 19:54:34 CEST 2015


On 08/14/2015 07:47 PM, Simon Iten wrote:
> ah cool, thanks!
> 
> is there a way to make a slider with only int values? (other than using int after the slider)

tweak the size of the slider so that each pixel corresponds to an
integer value :-(

but then:
- you can shift-drag he slider (just as with numberboxes), to get finer
resolution (1%)
- if you also have numberboxes in the game, the user could manually
enter a fractal number (apart from shift-dragging)

so i think the only sane way to ensure integer numbers is by casting
them to [int] at the receiving side.

personally i even prefer the [int] because it is made explicit in the
patch (whereas all magic you do within the gui-properties of the slider
are non-obvious).

vmsdr
IOhannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20150814/c085b3be/attachment.sig>


More information about the Pd-list mailing list