开发者

Matlab GUI's managebuttons

开发者 https://www.devze.com 2023-03-19 17:29 出处:网络
I have to maintain a large MATLAB GUI, containing quite a few callback functions, each of which gets called at many points.At some point, I decided to rename one of the callbacks; in order not to have

I have to maintain a large MATLAB GUI, containing quite a few callback functions, each of which gets called at many points. At some point, I decided to rename one of the callbacks; in order not to have to go through GUIDE to manually modify each of the UI that calls it, I used the excellent gencode program to "unwrap" the .fig file, s/old_name/new_name/g, and recreate the .fig.

This seems to work well, except for one thing: when clicking on a button in a button group, I got a message telling me that the function manageButtons is unknown. After a bit of googling, I find that manageButtons is a nested function in childAddedCbk, which, I assume, is called by GUIDE as the GUI is created. Now, trying to move just manageButtons outside to its own, in-the-path file doesn't work either: the hgroup passed to it is an invalid handle object.

So... does anyone has a workaround for that? Any of the following will be appreciated:

  • changing all the callbacks in a GUI in a semi-automatic way, or
  • making the manageButtons get a valid handle, or
  • having gencode not break all that.
开发者_运维知识库

Thanks,

Antony


You can export the FIG + M file to single .m file. You will lose the ability to edit this with guide, but you will be able to do a simple regular expression replace on the resulting .m file.

In order to do so - use on the menu of GUIDE -> File -> Export.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号