[Scilab-users] Xcos custom block - icon path problem

Clément David clement.david at scilab-enterprises.com
Mon Oct 14 11:27:14 CEST 2013


Hello Peter,

In my view, the palette should be created on toolbox loading (eg. on
the .start file) because, as you highlight, path may vary between
built-time and load-time. Furthermore, palette creation does not require
many computation time and perform only runtime consistency checks.

As a reference, please take a look at the xcos_toolbox_skeleton on the
SCI/contrib directory.

Regards,

--
Clément

Le dimanche 13 octobre 2013 à 20:55 +0200, pf a écrit :
> Hi all,
> 
> small problem with Xcos palette export (Scilab 5.5.0, Ubuntu 12.04):
> 
> If I want to create a new palette with Xcos block with graphic icon in
> 'builder.sce'
> 
> pal=xcosPal("MyPalette");
> pal=xcosPalAddBlock(pal, MyInterface("define"), [], mypath
> +"../macros/icons/myIcon.svg");
> 
> then macro 'xcosPalAddBlock' create/generate GIF icon in TEMP directory.
> 
> If I then export palette to file 
> 
> xcosPalExport(pal, mypath + '/MyPalette.pal');
> 
> in file 'MyPalette.pal' path to GIF icon indicates to TEMP directory
> (!!!) 
> And when I load palette with a.e. XcosMyModule.start (after new start
> etc.) with macro
> 
> xcosPalAdd(mypath + '/MyPalette.pal');
> 
> icons no longer exists (old TEMP was meantime deleted) and I get block
> in Palette browser without icons ... :-(
> 
> I think that the GIF icon would be created in the same directory as
> original (a.e *.svg, *.jpg ....) image(s) and path in exported palette
> (*.pal) should point to this directory.
> 
> ==================================
> 
> Temporary problem solution - not ideal, but works:
> 
> -> palette can be created at startup in *.start file, without export,
> Palette browser load icons from TEMP directory
> 
> 
> With regards
> Peter
> 
>  
> 
> 
>   
> 
> 
> 
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users





More information about the users mailing list