Saving TextField text to json

Hi, this is my first go at a module so go easy :smile:

Seems like a simple thing. I have some text fields and want to save/retrieve these to json. In the widget constructor I create them with createWidget(), add them with addChild(). The obvious thing was to have a member variable array of pointers that get assigned with these TextFields. Then in my overriden dataToJson/dataFromJson I can refer use them.

That worked as expected. But it crashes the module browser, which was a surprise. I believe the crash is where I assign the TextFields to the array.

Makes me thing there’s supposed to be another way to get at these Widgets? Something akin to the inputs() or outputs()?

Just a nudge in the right direction would be helpful, thank you

I’ve sent you a message, I fixed the issue couple minutes ago.

Thanks Omer.

No, I’ve got it - I worked out that the Widget constructor, with signature *module, doesn’t get sent a module reference when invoked from the module browser. d’Oh. All is well with the world now.

Capture

1 Like

We’ve all done that at least once :wink:

2 Likes