I am trying to develop a GUI in Octave (4.0.1, using the GUI version) with the code as follows:
- Main GUI function
- Function to create figure & various
uicontrol
- Callback function for
uicontrol
#1 - Callback function for
uicontrol
#2 - Callback function for
uicontrol
#3 - etc...
- Function to create figure & various
Each function is delimited by function
& end
. The first callback I tried to write looks like this: the button is defined in the "graphical creation" function as:
gui.select_btn = uicontrol('Style','pushbutton','String','Select log file ...',...
'Units','normalized','Position',[0.01 0.52 0.25 0.47],...
'BackgroundColor',get(gui.Window,'Color'),'Parent',gui.file_panel,...
'Enable','on','Callback',{@browse_log_file,gui});
and the callback for it is defined in the callback function later as:
function browse_log_file(src,data,gui)
% Called when user presses the "Select log file ..." button
[fname, pname] = uigetfile({'*.log'},'Select log file');
set(gui.log_file_edit,'String',[pname,fname]);
end
whi gui
being a struct
defined in the main GUI function by calling the "graphical creation" function & accessible by all nested functions.
However, when I try to run the code, I get the following error message:
error: handles to nested functions are not yet supported
error: called from
GUI_analyser>create_interface at line 71 column 20
GUI_analyser at line 8 column 7
error: evaluating argument list element number 1
error: called from
GUI_analyser>create_interface at line 71 column 20
GUI_analyser at line 8 column 7
error: evaluating argument list element number 16
error: called from
GUI_analyser>create_interface at line 71 column 20
GUI_analyser at line 8 column 7
pointing to the line with {@browse_log_file,gui}
.
Any suggestions on how to work round this problem?