Cabbage Logo
Back to Cabbage Site

Is there going to be a "cabbageDestroy"?

I’m thinking of creating a cabbage object where I might need the ability to delete an object that is no longer needed. And this raises the question if it is possible to delete something from the gui? Are there plans for a “cabbageDestroy”?

I’ve got two ideas here. So, let me describe them.

  1. If a widget could have a “destroy()” message, that would take care of getting rid of a single widget from the gui.

  2. With the recent discussion of allowing adding objects to a “parent” object (a groupbox or an image), this would raise the question of how this “parent” might delete its entire set of widgets. Because the “destroy()” message would delete the “parent” itself, there would have to be a second message to delete its contents. So, seems something like “deleteContents()” might work.

Or is this not possible because of vst issues?

(on a completely different issue! I didn’t format the text at all. I just put “1.” in front of a line of text, and the board software did the rest… Cool! Nice to know.)

Destroying a widget that is being used by the host would cause all sorts of problem. So I’m hesitant to look into this further. But you can just make them invisible. They won’t take up a lot of memory. This would definitely be safer.

I understand that, I’ll have to keep track of how many of these display widgets I create, and reuse them when I need to…

1 Like

which leads me to the question, which widget would be the least of a memory user? I figured that an ‘image’ without an actual image would probably be the best, if not among the best to use. Basically, I’m just going to be moving them around and changing their colors and alpha…

I don’t think any of them present much of a memory problem. Even the soundfiler widget use thumbnail caches to represent the samples. I’ve never seen any issues with memory, but perhaps I have never look hard enough :laughing: