Prev: Javabuilder problem; Can't find nativemcl.dll
Next: weird issue with complex signum, see below:
From: us on 19 Jun 2010 01:51 "Ryan " <jryanrigby(a)gmail.com> wrote in message <hvhl8b$mn4$1(a)fred.mathworks.com>... > > > in your callback G1FUNC you use your data struct FG... > > but: where does it come from(?)... > > > > us > > every time i declare a handle for a button, i declare the handle as a field in FG. for example > > FG.button1handle = uicontrol(... well, yes... but, again, looking at your code snippet i don't see how G1FUNC has access to this struct... us
From: Matt Fig on 19 Jun 2010 01:51 I do not understand why you seem to be mixing switchyard programming for the callbacks with function handles for the selectionchangefcn. Why not just use nested functions for all callback types, thus getting rid of the switchyard and the globals in one step? In any case, this does seem to work: function NA(Action) global FG if nargin==0 Action = 'Initial'; end switch (Action) case 'Initial' FG.g1 = uibuttongroup(... 'selectionchangefcn',@g1func); FG.b1 = uicontrol('style','toggle',... 'Callback','NA(''test1'')'); % This is evaluated at the command line. case 'test1' FG % Display what is in FG.... end
From: Walter Roberson on 19 Jun 2010 03:00 Ryan wrote: > this is not a GUIDE GUI. after declaring the function, global FG is > declared Variables must be declared global in every function that uses them.
From: Ryan on 19 Jun 2010 11:12 Walter Roberson <roberson(a)hushmail.com> wrote in message <qWZSn.103505$_84.21671(a)newsfe18.iad>... > Ryan wrote: > > > this is not a GUIDE GUI. after declaring the function, global FG is > > declared > > Variables must be declared global in every function that uses them. i don't need to declare FG as global within the selectionchangefcn because when i run my code it accesses it just fine. with regards to cases within my main function, should i have to declare them global even though they are in the same function that declared them?
From: Walter Roberson on 19 Jun 2010 12:02 Ryan wrote: > Walter Roberson <roberson(a)hushmail.com> wrote in message > <qWZSn.103505$_84.21671(a)newsfe18.iad>... >> Ryan wrote: >> >> > this is not a GUIDE GUI. after declaring the function, global FG is >> > declared >> >> Variables must be declared global in every function that uses them. > > i don't need to declare FG as global within the selectionchangefcn > because when i run my code it accesses it just fine. I see what you mean: you are using nested variables. When I looked the first time, I did not see the final 'end' that indicated nesting. I think we will need to see the code for the first callback.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: Javabuilder problem; Can't find nativemcl.dll Next: weird issue with complex signum, see below: |