saveShelf
string string
saveShelf は、取り消し可能、照会不可能、および編集不可能です。
このコマンドは指定されたシェルフ(1 番目の引数)を指定されたファイル(2 番目の引数)に保存します。 このコマンドは、MEL および Python コマンドのコールバックが混在するコントロールと一緒に使用すると、正しく動作しないことに注意してください。また、メニューの状態が MEL ファイルに保存されるため、コール可能な Python オブジェクトであるコールバックに対しては動作しません。| boolean | 成功の場合は true です。 |
// Create a window with a shelf in it.
//
string $window = `window`;
string $tabs = `tabLayout`;
string $shelf = `shelfLayout`;
shelfButton -image1 "commandButton.png" -command ("print \"Hello\\n\"");
tabLayout -edit -tabLabel $shelf "Example Shelf" $tabs;
showWindow $window;
// At this point the example would be made more interesting if you
// put some additional items on this shelf.
// Now save the shelf in the temp directory.
//
string $tempDir = `internalVar -userTmpDir`;
saveShelf $shelf ($tempDir + "ExampleShelf");