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 - Português - Русский
Scilabヘルプ >> GUI > saveGui

saveGui

グラフィックユーザインターフェイスをファイルに保存

呼び出し手順

saveGui(fig, filename)

引数

fig

ハンドル, 現在の図のハンドル

filename

ファイルのパスを有する文字列

説明

saveGui 関数はグラフィックユーザ インターフェイスをファイルに保存する際に使用でき, loadGui 関数で読み込めます.

saveGui(f, filename) は現在の グラフィックハンドル f を filenameで定義されたファイルに保存します.

// 最初の例
f = figure("background", -2);
h = uicontrol(f, "style", "text", ...
              "string", "This is a figure", ...
              "position", [210 180 300 100], ...
              "fontsize", 24, ...
              "backgroundcolor", [1 1 1]);
saveGui(f, fullfile(TMPDIR, "foo"))
close(f)
loadGui(fullfile(TMPDIR, "foo"));
// 2番目の例
f = figure("default_axes", "off", ...
           "dockable", "off", ...
           "figure_name", "Sélection", ...
           "axes_size", [200 200], ...
           "infobar_visible", "off", ...
           "menubar_visible", "off", ...
           "toolbar", "none", ...
           "toolbar_visible", "off", ...
           "layout", "gridbag");
h1 = uicontrol(f, "style", "text", ...
                "string", "Following List :", ...
                "fontsize", 15, ...
                "constraints", createConstraints("gridbag", [1 1 2 1], [1 0], "both"));
h2 = uicontrol(f, "style", "popupmenu", ...
                "string", ["item1"; "item2"; "item3"], ...
                "value", 1, ...
                "fontsize", 15, ...
                "constraints", createConstraints("gridbag", [1 2 2 1], [1 0], "both"), ...
                "tag", "selection");
h3 = uicontrol(f, "style", "pushbutton", ...
                "string", "OK", ...
                "callback", "obj = findobj(""tag"", ""selection""); mprintf(""La valeur sélectionnée est : %s.\n"", obj.string(obj.value)); close(gcf())", ...
                "fontsize", 15, ...
                "constraints", createConstraints("gridbag", [1 3 1 1], [1 0], "both", "left"));
h4 = uicontrol(f, "style", "pushbutton", ...
                "string", "CANCEL", ...
                "callback", "close(gcf())", ...
                "fontsize", 15, ...
                "constraints", createConstraints("gridbag", [2 3 1 1], [1 0], "both", "right"));
saveGui(f, "TMPDIR/foo2.xml");
close(f)
loadGui("TMPDIR/foo2.xml")

参照

  • loadGui — 保存されたファイルからグラフィックユーザインターフェイスを読み込む
  • load — Loads some archived variables, a saved graphic figure, a library of functions
  • save — Saves some chosen variables in a binary data file

履歴

バージョン記述
5.5.0 関数 saveGui が導入されました.
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Feb 14 15:02:16 CET 2019