Cellのオプションで,指定されたイベントがノートブック中のセルとの関連で起ったときに実行するアクションのリストを与える.
CellEventActions
Cellのオプションで,指定されたイベントがノートブック中のセルとの関連で起ったときに実行するアクションのリストを与える.
詳細
- CellEventActions->{"event1":>action1,"event2":>action2,…}は,セルとの関連で"eventi"が起るたびに actioni を評価するように指定する.
- 可能なイベント指定は EventHandlerと同じである.
- CellEventActionsの設定値は,個々のセルやノートブックよりもスタイルシートのレベルで定義されることが多い.
- デフォルトで,イベントのためにCellEventActionsで指定されたアクションは,Wolframシステムがそのイベントのために取るであろういかなるアクションをも無効にする.
- デフォルトの動作は,CellEventActionsの設定値として与えられるリスト中のPassEventsDownまたはPassEventsUp の規則を含むようにすることで変更できる.
例題
すべて開く すべて閉じる例 (1)
スコープ (1)
オプション (1)
PassEventsDown (1)
通常では,"MouseClicked"ハンドラによってセルの選択が阻まれる:
CellPrint[TextCell["このセルは選択できません", "Output", Background -> LightRed, CellEventActions -> {"MouseClicked" :> (CurrentValue[EvaluationCell[], Background] = RandomColor[])}]]クリックで引き起こされるが選択は許容するイベントハンドラを作る:
CellPrint[TextCell["このセルは選択可能です", "Output", Background -> LightRed, CellEventActions -> {"MouseClicked" :> (CurrentValue[EvaluationCell[], Background] = RandomColor[]), PassEventsDown -> True}]]考えられる問題 (1)
セル挿入ポイントにタイプしても,CellEventActionsはトリガされない:
NotebookCreate[CellEventActions -> {{"KeyDown", "a"} :> Beep[]}]関連するガイド
テキスト
Wolfram Research (2007), CellEventActions, Wolfram言語関数, https://reference.wolfram.com/language/ref/CellEventActions.html.
CMS
Wolfram Language. 2007. "CellEventActions." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CellEventActions.html.
APA
Wolfram Language. (2007). CellEventActions. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CellEventActions.html
BibTeX
@misc{reference.wolfram_2026_celleventactions, author="Wolfram Research", title="{CellEventActions}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/CellEventActions.html}", note=[Accessed: 17-August-2026]}
BibLaTeX
@online{reference.wolfram_2026_celleventactions, organization={Wolfram Research}, title={CellEventActions}, year={2007}, url={https://reference.wolfram.com/language/ref/CellEventActions.html}, note=[Accessed: 17-August-2026]}