低レベル関数ButtonBoxのオプションとして使われ,ボタンに関連付けられたButtonFunctionの第1引数を指定する.このオプションは,アクティブなボタンがクリックされたときに有効になる.
ButtonSource
低レベル関数ButtonBoxのオプションとして使われ,ボタンに関連付けられたButtonFunctionの第1引数を指定する.このオプションは,アクティブなボタンがクリックされたときに有効になる.
詳細
- デフォルトはButtonSource->Automaticである.
- 設定可能な指定値
-
Automatic 設定済みのButtonData,なければButtonContents ButtonContents ButtonBoxの第1引数 ButtonData ButtonDataオプションの設定値 Cell ボタンの帰属するセル CellContents ボタンの帰属するセルの全内容 Notebook ボタンの帰属するノートブック n ノートブック式においてボタン位置から数えて n レベル上にある式
例題
例 (4)
それ自身のButtonDataを出力するボタンを作る:
CellPrint[Cell[TextData[ButtonBox["クリックしてボタンデータを得る", Evaluator -> Automatic, ButtonFunction -> (Print[#]&), ButtonSource -> ButtonData, ButtonData -> "データ", Appearance -> "DialogBox"]], "Text", FontColor -> Blue]]CellPrint[Cell[TextData[ButtonBox["クリックしてボタンのコンテンツを得る", Evaluator -> Automatic, ButtonFunction -> (Print[#]&), ButtonSource -> ButtonContents, ButtonData -> "データ"]], "Text", FontColor -> Blue]]ButtonSource->Automaticは,設定されるとボタン関数がButtonDataに作用することを意味する:
CellPrint[Cell[TextData[ButtonBox["クリックしてデータまたはコンテンツを得る", Evaluator -> Automatic, ButtonFunction -> (Print[#]&), ButtonSource -> Automatic, ButtonData -> "データ"]], "Text", FontColor -> Blue]]ButtonDataが設定されていなければ,ButtonSource->Automaticはボタンがそのコンテンツに作用するようにする:
CellPrint[Cell[TextData[ButtonBox["クリックしてデータまたはコンテンツを得る", Evaluator -> Automatic, ButtonFunction -> (Print[#]&), ButtonSource -> Automatic]], "Text", FontColor -> Blue]]履歴
1996 で導入 (3.0)
テキスト
Wolfram Research (1996), ButtonSource, Wolfram言語関数, https://reference.wolfram.com/language/ref/ButtonSource.html.
CMS
Wolfram Language. 1996. "ButtonSource." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ButtonSource.html.
APA
Wolfram Language. (1996). ButtonSource. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ButtonSource.html
BibTeX
@misc{reference.wolfram_2026_buttonsource, author="Wolfram Research", title="{ButtonSource}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/ButtonSource.html}", note=[Accessed: 17-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_buttonsource, organization={Wolfram Research}, title={ButtonSource}, year={1996}, url={https://reference.wolfram.com/language/ref/ButtonSource.html}, note=[Accessed: 17-August-2026]}