|
From: | Doug Stewart |
Subject: | Re: Function handle with arguments for GUI callback |
Date: | Wed, 13 Mar 2013 09:27:23 -0400 |
It looks like there is a constant offset of 48 between what the value of k is and what it should be, so for now, I am using the following:function update_browse_btn(src,data,k,gui)% Called when user activates popup menuval = get(src,'Value');if val == 2set(gui.browse_btns{k-48},'Enable','on');set(gui.ip_file_edit{k-48},'Enable','on');elseset(gui.browse_btns{k-48},'Enable','off');set(gui.ip_file_edit{k-48},'Enable','off');endendThis works well for all the scenarios and all possible values of k, but I am slightly uneasy at having an unexplained, hard-coded, offset in the code, even if this is only a prototype (the final version will probably be coded in C# for deployment to end-users). Anyway, it does the job for now until I find a more elegant and more robust solution.Thanks,ArnaudOn 12 March 2013 09:02, Arnaud Miege <address@hidden> wrote:
On 11 March 2013 18:31, Michael Goffioul <address@hidden> wrote:
This is standard Matlab behavior:(look for "Use Cell Arrays with Strings")You are right of course, sorry.As the object is a cell array, you need to index it with {}, but from what you saying, it doesn't work either. Does it change anything if you do an assignment instead:x = gui.browse_btns{k}xNo IVm afraid it doesn't. Don't know why it says k is 49 when used to index, and 3 when displaying it.I will maybe try tagging the different uicontrols to circumvent the problem.Thanks,Arnaud
_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave
[Prev in Thread] | Current Thread | [Next in Thread] |