Cabbage Logo
Back to Cabbage Site

Is it possible to overwrite the procedure of button_file

Hello all,
Using the button file for saving snapshots presets, i see that some groupbox I would like to be closed are getting saved as visible(1).
Is it possible to do something like : when the button_file to save snapshot is pressed , then call my instrument closing all groupboxes and then,only, save the snapshot ?

thanks for help

presets currently only save the value of each widget, not the state of each identifier for that widget. But I can look into saving this information too. I don’t know how big a job it will be but I’ll look into it.

[edit] I just took a quick look at this. It would be quite a job to support all widget identifiers, but I could certainly add visible() I think…

Maybe easier … But I don’t know if this is feasible :
Create a specific named instrument or a macro always called when a button_file is pressed. Then it would be to the user to fill in this MACRO / Instrument / opcode
i.e
instr BUTTON_FILE_TRIGGERED
; Here user put what he wants to do with the interface
endin

Can the responsibility not be left with the Csound code? Presumably there will be a chunk of code that conditionally makes the widget visible or invisible. Is it not therefore possible to simply retest the conditional whenever a preset change has been made?