ButtonBar[{lbl1:>act1,lbl2:>act2,…}]
ラベル lbliのボタンが押されるとアクション actiを行うボタンバーを表す.
ButtonBar
ButtonBar[{lbl1:>act1,lbl2:>act2,…}]
ラベル lbliのボタンが押されるとアクション actiを行うボタンバーを表す.
詳細とオプション
- lbliと actiは任意の式でよい.
- ButtonBarはButtonと同じオプションを持つ.
- Appearanceオプションで使える追加的な設定
-
"Horizontal" 水平方向に等間隔 "Vertical" 垂直方向に等間隔 "Row" テキストのようにレイアウト,行の折り返し可 -
Alignment Automatic ボタン内のコンテンツの並べ方 Appearance Automatic ボタンの全体的な外見 AutoAction False マウスが上に置かれたときに自動的にボタンをクリックするかどうか Background Automatic ボタンの背景色 BaselinePosition Automatic 周囲のテキストと相対的な並べ方 BaseStyle "GenericButton" ボタンのベーススタイル指定 ContentPadding True 余白をコンテンツの周囲ぎりぎりまで縮めるかどうか Enabled Automatic ボタンを有効にするか,灰色(無効)にするか Evaluator Automatic expr を評価するカーネル FrameMargins Automatic 枠内に残す最低限の余白 ImageMargins 0 表示されたボタンの画像周囲の余白 ImageSize Full 表示されたボタンの全体的な大きさ Method "Preemptive" 使用する評価法 Tooltip None ボタンのためのツールチップ TooltipDelay 0.` ツールチップの表示までの遅延時間 TooltipStyle {} ツールチップのスタイル指定
全オプションのリスト
例題
すべて開く すべて閉じる例 (1)
オプション (16)
Alignment (1)
AutoAction (2)
ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}]AutoActionと設定することで,マウスがボタンエリアの上に来るとボタン関数が評価されるようにする:
ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}, AutoAction -> True]Background (1)
Enabled (2)
Evaluator (3)
ButtonBar[{"a" :> CellPrint[1], "b" :> CellPrint[2], "c" :> CellPrint[3]}]Evaluatorを設定すると,ボタン関数はフロントエンドで評価される:
ButtonBar[{"a" :> CellPrint[1], "b" :> CellPrint[2], "c" :> CellPrint[3]}, Evaluator -> None]ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}, Evaluator -> None]FrameMargins (1)
FrameMarginsを設定すると,ボタンのコンテンツエリアが大きくなる:
Table[ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}, FrameMargins -> m], {m, {0, 5, 10, 20}}]ImageMargins (1)
ImageMarginsを設定すると,ボタンエリアが大きくなる:
Table[Framed@ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}, ImageMargins -> m], {m, {0, 5, 10, 20}}]ImageSize (4)
Table[ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}, ImageSize -> i], {i, {Tiny, Small, Medium, Large}}]Column[Table[ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}, ImageSize -> i], {i, {50, 100, 150}}]]ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}, ImageSize -> {Automatic, 50}]ButtonBar[{"a" :> Print[1], "b" :> Print[2], "c" :> Print[3]}, ImageSize -> {100, 50}]Method (1)
ボタン関数は,5秒で時間切れとなるプリエンプティブリンクで評価される:
DynamicModule[{a = "start", f = Function[Pause[6];a = "end"]}, {ButtonBar[{"a" :> f[], "b" :> f[], "c" :> f[]}], Dynamic[a]}]Method->"Queued"を使って,決して時間切れにならないメインリンクでボタン関数を評価するようにする:
DynamicModule[{a = "start", f = Function[Pause[6];a = "end"]}, {ButtonBar[{"a" :> f[], "b" :> f[], "c" :> f[]}, Method -> "Queued"], Dynamic[a]}]関連するガイド
関連するワークフロー
- パレットを作成する ▪
- Manipulateを構築する
テキスト
Wolfram Research (2008), ButtonBar, Wolfram言語関数, https://reference.wolfram.com/language/ref/ButtonBar.html.
CMS
Wolfram Language. 2008. "ButtonBar." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ButtonBar.html.
APA
Wolfram Language. (2008). ButtonBar. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ButtonBar.html
BibTeX
@misc{reference.wolfram_2026_buttonbar, author="Wolfram Research", title="{ButtonBar}", year="2008", howpublished="\url{https://reference.wolfram.com/language/ref/ButtonBar.html}", note=[Accessed: 07-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_buttonbar, organization={Wolfram Research}, title={ButtonBar}, year={2008}, url={https://reference.wolfram.com/language/ref/ButtonBar.html}, note=[Accessed: 07-September-2026]}