Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - 日本語 - Русский

Please note that the recommended version of Scilab is 6.1.1. This page might be outdated.
However, this page did not exist in the previous stable version.

Ajuda do Scilab >> Xcos > Scilab Utilities Functions > xcosAddToolsMenu


Add a menu item into the Xcos "Tools" menu.

Calling Sequence

xcosAddToolsMenu(label, command)



Add a menu into Xcos with a scilab command. The scilab command can assume that there is two variable on the current scilab context :

  • blk : The selected block. Variable does not exist if nothing is selected. The variable has a scicos_block type.

  • scs_m : The whole diagram. The variable has a scicos_diagram type.

This function has been introduced in Scilab 5.4.0.

xcosAddToolsMenu("print plop", "disp(''plop'')");
xcosAddToolsMenu("print selected block", "disp(blk)");
xcosAddToolsMenu("print diagram", "disp(scs_m)");

// define a custom update function
function myUpdateFunction(blk, scs_m)
    execstr(''[ok, blk] = '' + blk.gui + ''(''''set'''', blk)'') ;
    xcosUpdateBlock(blk) ;
xcosAddToolsMenu("update block", "myUpdateFunction(blk, scs_m)");


Clément David - Scilab Enterprises

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Apr 01 10:24:29 CEST 2015