Problem in graphic properties management with callbacks

goudier at free.fr goudier at free.fr
Sun Sep 18 16:35:04 CEST 2011


Hi,

I have a problem to set color of polygons in a callback function :
With one polygon as above example "Mono_Spot.sce" it works perfectly.

When several handles of polygons are setted in a slider callback,
 colors sets of polygons are not well done.
See malfunction with example "Spots.sce" attached file.

Is it a bug ?

Regards
------------------------------------------------------------------------------
Example : Mono_Spot.sce

function set_R ();
     set(pr,'background',color(sldr.value,0,0)); // set polygon color in
callback
endfunction

L1=sqrt(3);L2=2*L1;L3=3*L1;
X_R=[0 -2 -3 -2];Y_R=[0 L2 L1 0];Y_R=Y_R-3*L1/2; // points of polygon
lines(0);
fg=figure('backgroundcolor',[0.59  0.96 .99],'figure_name','Spots');
fg.figure_position = [700,100];
fg.axes_size = [480,280];
fg.children.data_bounds = [-18,-8;6,6];
fg.children.isoview = "on";
xfrect(-4,8,18,18);  // black screen
// Control Slider
sldr=uicontrol('Parent',fg,'style','slider','MIN',0,'Max',255,'Position',[40,60,20,140],'callback',"set_R");
xfpoly(2.5*X_R+5,2.5*Y_R,1);pr=get('hdl');pr.thickness=0; // polygon pr handle

----------------------------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Mono_Spot.sce
Type: application/octet-stream
Size: 665 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20110918/3a788158/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Spots.sce
Type: application/octet-stream
Size: 3086 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20110918/3a788158/attachment-0001.obj>


More information about the users mailing list