tweakpane icon indicating copy to clipboard operation
tweakpane copied to clipboard

Readonly without update

Open 2mik opened this issue 1 year ago • 4 comments

Hello,

If we set readonly to true, parameter will be updated and change events occur every interval. For example:

pane.addBinding(PARAMS, 'time', {
  readonly: true,
  interval: 1000,
});

How to display simple readonly parameter that is not editable and should not be updated? Thank you.

2mik avatar Feb 28 '25 11:02 2mik

hi, you can try to pass interval: 0, in which case Tweakpane would use a {{ManualTicker}} under the hood. if I understand correctly, it won't trigger updates unless you specifically tell it to do so.

alvov-evo avatar Aug 21 '25 09:08 alvov-evo

Hi, Do you know where this is implemented in the source code?

2mik avatar Aug 21 '25 12:08 2mik

ticker is created here https://github.com/cocopon/tweakpane/blob/main/packages/core/src/monitor-binding/plugin.ts#L117

then it is passed to the MonitorBindingValue constructor in the same file a bit lower on line 169

alvov-evo avatar Aug 21 '25 13:08 alvov-evo

Thank you!

2mik avatar Aug 21 '25 13:08 2mik