[Scilab-users] uicontrol, callbacks, handle not valid anymore

Sandro Hardy sandro.hardy at kom.tu-darmstadt.de
Wed Jul 10 20:24:19 CEST 2013


Hello everybody,

I am trying to create a GUI to scroll trough a signal using a slider.

I always get a "Handle not valid anymore", looking as shown below. Is 
this a bug in Scilab?

Using the arrows works fine, but dragging the slider with the mouse 
produces the error. Maybe it is a timing/scheduling problem in Scilab.

Please find example code below, if you like to reproduce this.

I would be happy about any hint.
Best wishes
Sandro


------------------------------------------
!--error 999
set: diese Handhabung ist nicht mehr gültig.
at line       4 of function generic_i_h called by :
at line       2 of function %s_i_h called by :
at line     381 of function plot called by :
at line       7 of function slider_update called by :
df0:13fc997f6bd:-2f41");slider_update;if exists(
while executing a callback
at line     352 of function plot called by :
at line       7 of function slider_update called by :
df0:13fc997f6bd:-2f41");slider_update;if exists(
while executing a callback
at line       2 of function %h_e called by :
at line      33 of function findobj called by :
at line       2 of function slider_update called by :
df0:13fc997f6bd:-2f41");slider_update;if exists(
while executing a callback

------------------------------------
clear
clearglobal

maxv=1000;
x=1:0.1:maxv;
y=sin(x);

function slider_update()
     slider=findobj('Tag', 'plot_slider')
     start=round(slider.Value*0.9);
     r=start:start+100;
     scf(plotfr)
     clf(plotfr)
     plot(x(r),y(r));
endfunction

// Create a figure
f = figure("Figure_name", 'Uicontrols Slider',...
     "Position",[100 100 510 510],...
     "BackgroundColor",[0.9 0.9 0.9],...
     "Tag", "uicontrols_demo_figure");
// Frame containing a slider

plotfr = figure("Figure_name", 'Uicontrols Plot',...
     "Position",[100 100 510 510],...
     "BackgroundColor",[0.9 0.9 0.9],...
     "Tag", "uicontrols_demo_figure2");

slider = uicontrol(f, "Position", [20 50 390 15], ...
     "Style", "slider", ...
     "Min", 0, ...
     "Max", 900, ...
     "Value", 0, ...
     "SliderStep", [10 100], ...
     "Tag", "plot_slider", ...
     "Callback", "slider_update");
--------------------------------------------------
-- 
Sandro Hardy, M.Sc.

Multimedia Communications Lab (KOM)
http://www.kom.tu-darmstadt.de
Technische Universitaet Darmstadt
Dept. of Electrical Engineering & Information Technology
tel: +49 6151 16 75164 fax: +49 6151 16 6152
E-Mail: Sandro.Hardy at kom.tu-darmstadt.de
postal address: TU Darmstadt, FB 18, KOM, Rundeturmstr. 10, S320/106
D-64283 Darmstadt, Germany



More information about the users mailing list