abey79/vsketch

Unable to change the value of a text param at runtime

Closed this issue · 1 comments

I'm getting an error at runtime when I try to update a text based param:

Traceback (most recent call last):
  File ".../vsketch/venv/lib/python3.8/site-packages/vsketch_cli/param_widget.py", line 115, in update_param
    self._param.set_value_with_validation(self.text())
AttributeError: 'TextParamWidget' object has no attribute 'text'

It looks like that error is coming from here:

self._param.set_value_with_validation(self.text())
Is it possible that this should be using self.toPlainText() instead of self.text()?

To repro:

class Sketch(vsketch.SketchClass):
    my_param = vsketch.Param("abc")

Run vsk run sketch, and then try to change the value of "my_param" using the text input.

Hello, thanks for the report. I'll have to check tomorrow, but I maybe that str-based vsketch.Param instances require the choices parameter. The generic text field might not yet be implemented. If so, this would definitely be a shortcoming that needs addressing.