[Scilab-users] Using uimenue to change rotation_angles

Jens Simon Strom j.s.strom at hslmg.de
Sun Dec 18 14:34:33 CET 2016


Hi Rafael,
The script is perfect. I can adapt it to my original problem. Sometimes 
a little nap/sleep can cause a wonder.:-)
Kind regards
Jens
-----------------------------------------------------------------------------------
Am 18.12.2016 13:56, schrieb Rafael Guerra:
>
> Hi Jens,
>
> Sleep may help. Please check code:
>
> //START OF CODE
>
> f = figure(1)
>
> param3d([0 1 1 1],[0 0 1 1],[0 0 0 1]);
>
> ca=gca();
>
> ce=gce();
>
> ce.thickness=10;
>
> alpha=ca.rotation_angles(1);//initial alpha
>
> m1= uimenu(f,'label','alpha=90','callback','alpha=90');
>
> m2= uimenu(f,'label','alpha=10','callback','alpha=10');
>
> m3= uimenu(f,'label', 'quit', 'callback', "t=%f");
>
> t=%t;
>
> whilet==%t
>
> sleep(300);// Adjust to user speed
>
> printf("alpha=%i\r", alpha)
>
> ca.rotation_angles(1)= alpha;
>
> end
>
> close(f)
>
> //END OF CODE
>
> Regards,
>
> Rafael
>
> *From:*users [mailto:users-bounces at lists.scilab.org] *On Behalf Of 
> *Jens Simon Strom
> *Sent:* Sunday, December 18, 2016 11:36 AM
> *To:* International users mailing list for Scilab. 
> <users at lists.scilab.org>
> *Subject:* [Scilab-users] Using uimenue to change rotation_angles
>
> Hi,
> I try to use uimenue() in a minimal example to toggle the aspect of a 
> 3D curve between two values - without succes.
> Here is my defective script.
>
> //BEGIN OFUNFUNCTIONAL  CODE
> xdel()
> figure(1)
> param3d([0 1 1 1],[0 0 1 1],[0 0 0 1]);ce=_gce_();ce.thickness=10;
> ca=_gca_();
> alpha=ca.rotation_angles(1);///initial alpha/
>    uimenu('label', 'alpha=0', 'callback',"alpha=70");
>    uimenu('label', 'alpha=90', 'callback',"alpha=10");
>    uimenu('label', 'break', 'callback',"break");
> while 1
>    xclick()   //to interrupt script, enable click on label, and restart
>    ca.rotation_angles(1)=alpha;
>    disp(alpha)
> end
> //END OFUNFUNCTIONAL  CODE
>   
> Please give me a clue for a feasible route.
>   
> Kind regards
> Jens
>   
>   
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20161218/1282123a/attachment.htm>


More information about the users mailing list