gpt4 book ai didi

wolfram-mathematica - Mathematica 中 LocatorPane 图形上的右键单击菜单

转载 作者:行者123 更新时间:2023-12-03 01:28:02 24 4
gpt4 key购买 nike

在 Mathematica 中右键单击图形时,您会看到一个上下文菜单(剪切图形、复制图形、将图形另存为...),但对于 LocatorPane 图形,此右键单击菜单被禁用。如何在 Mathematica 中使用 EventHandler 或 MouseAction 命令调用 LocatorPane 图形的上下文菜单?什么命令创建这个菜单?

LocatorPane[{1, 1}/2, Graphics[{Gray, Disk[]}]]

我发现这段代码可以在mathematica中打开“另存为”窗口。

FrontEndExecute[FrontEndToken["SelectionSaveSpecial"]]

我希望当我右键单击 LocatorPane 图形时打开“另存为”窗口。

最佳答案

不是完整的答案,但 Cell 的上下文菜单由 CellContextMenu 选项控制。您可以为您想要的任何单元格设置样式为 "Graphics"Cell 默认上下文菜单:

CellPrint[
Cell[BoxData[SuperscriptBox["x", "2"]], "Output",
ContextMenu ->
FEPrivate`FrontEndResource["ContextMenus", "Graphics"]]]

关于wolfram-mathematica - Mathematica 中 LocatorPane 图形上的右键单击菜单,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6144542/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com