I want to add an item to the Insert menu that executes a particular
kernel command and is activated by a particular shortcut key. And I want
to do this _without_ modifying and of the .tr files in
$InstallationDirectory/SystemFiles/FrontEnd/TextResources but only by
modifying files in the $UserBaseDirectory tree. (So that such changes
will be preserved across version updates.)
I know that in principle one can do this by creating (or editing an
existing) file:
Autoload`PacletManagerConfiguration``FrontEnd``init.m
Here's what I put there:
FrontEnd`AddMenuCommands["Input from Above",
{Delimiter,Item["Options &Explorer",
KernelExecute[ToExpression["OptionsExplorer[]"]],
MenuKey["o",Modifiers->{Control,Command}],
MenuEvaluator->Automatic]}];
But nothing happens after a restart of Mathematica with clean cache.
What's wrong? Did I err in indicating the Insert menu's entry "Item from
Above" referenced there? Or something else.
Note that the corresponding modification, instead, to MenuSetup.tr would be:
Item["Options &Explorer",
KernelExecute[ToExpression["OptionsExplorer[]"]],
MenuKey["o", Modifiers->{Control,Command}],
MenuEvaluator->Automatic]
(This is specifically to invoke Yuri Kandrashkin's OptionsExplorer
package. But of course my question has more general applicability.)
--
Murray Eisenberg murray@math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower phone 413 549-1020 (H)
University of Massachusetts 413 545-2859 (W)
710 North Pleasant Street fax 413 545-1801
Amherst, MA 01003-9305
|
|
0
|
|
|
|
Reply
|
murray (1874)
|
2/21/2012 11:17:18 AM |
|
Murray Eisenberg wrote:
>
> Here's what I put there:
>
> FrontEnd`AddMenuCommands["Input from Above",
> {Delimiter,Item["Options &Explorer",
> KernelExecute[ToExpression["OptionsExplorer[]"]],
> MenuKey["o",Modifiers->{Control,Command}],
> MenuEvaluator->Automatic]}];
>
> But nothing happens after a restart of Mathematica with clean cache.
> What's wrong? Did I err in indicating the Insert menu's entry "Item from
> Above" referenced there? Or something else.
There are two problems: the front end token for the Insert
menu position would be "DuplicatePreviousOutput", and, more
problematically, AddMenuCommands can only add simple
front end tokens like "OptionsDialog" (as demonstrated by
Andy Ross).
FrontEndExecute[AddMenuCommands["DuplicatePreviousOutput",
{Delimiter, MenuItem["Options &Explorer", "OptionsDialog",
MenuKey["O", Modifiers -> {"Control", "Shift"}]]}]];
On Feb 21, 11:17 am, Murray Eisenberg <mur...@math.umass.edu> wrote:
> I want to add an item to the Insert menu that executes a particular
> kernel command and is activated by a particular shortcut key. And I want
> to do this _without_ modifying and of the .tr files in
> $InstallationDirectory/SystemFiles/FrontEnd/TextResources but only by
> modifying files in the $UserBaseDirectory tree. (So that such changes
> will be preserved across version updates.)
>
> I know that in principle one can do this by creating (or editing an
> existing) file:
>
> Autoload`PacletManagerConfiguration``FrontEnd``init.m
>
> Here's what I put there:
>
> FrontEnd`AddMenuCommands["Input from Above",
> {Delimiter,Item["Options &Explorer",
> KernelExecute[ToExpression["OptionsExplorer[]"]],
> MenuKey["o",Modifiers->{Control,Command}],
> MenuEvaluator->Automatic]}];
>
> But nothing happens after a restart of Mathematica with clean cache.
>
> What's wrong? Did I err in indicating the Insert menu's entry "Item from
> Above" referenced there? Or something else.
>
> Note that the corresponding modification, instead, to MenuSetup.tr would be:
>
> Item["Options &Explorer",
> KernelExecute[ToExpression["OptionsExplorer[]"]],
> MenuKey["o", Modifiers->{Control,Command}],
> MenuEvaluator->Automatic]
>
> (This is specifically to invoke Yuri Kandrashkin's OptionsExplorer
> package. But of course my question has more general applicability.)
>
> --
> Murray Eisenberg mur...@math.umass.edu
> Mathematics & Statistics Dept.
> Lederle Graduate Research Tower phone413 549-1020begin_of_the_skype_highlighting 413 549-1020 (H)
> University of Massachusetts 413 545-2859begin_of_the_skype_highlighting 413 545-2859 (W)
> 710 North Pleasant Street fax 413 545-1801
> Amherst, MA 01003-9305
|
|
0
|
|
|
|
Reply
|
degnen (96)
|
2/25/2012 7:02:25 AM
|
|
|
1 Replies
56 Views
(page loaded in 0.081 seconds)
Similiar Articles: Could anyone give me the spice-mode.el - comp.emacsHi, All I am new to *NIX and I am thinking of writing spice code under Emacs. However, I have no idea of Emacs Lisp. Hence, I could not write a packa... C++ Customize Context Menus - comp.os.ms-windows.programmer.win32 ...... Context menus and a new menu item ... list my new option in the menu. But I am not sure how to add ... When a ^Q menu command is > activated with a second key ... Mac OS X - Disappearing Menu - comp.sys.mac.miscYes my use of Menu Eclipse is purely ... With some key combination, you'd click and a pop-up menu appeared, each item of which was ... > > There used to be an init or other add-on ... Problems With Very Basic Right-Click Popup Menu - comp.graphics ...When you create menu in GLUT (using glutCreateMenu()) it become ... glutAddMenuEntry () or glutAddSubMenu () will add items ... void KeyPress(unsigned char key, int x, int y ... shutdown vs. reboot - comp.unix.solarisAlways use "init 6" or "init 0" instead. If you want to ... on a simple sparc it's probably no big > deal, add ... deposited in bootargs.rc; with grub a temporary menu item ... Another Transparency Problem using png - comp.graphics.api.opengl ...In a nutshell, here is what I'm doing (I'm using C# with CsGL): // Init my ... Ok most folk add a new raster layer, Top item in layers menu. Using the flood tool ... JFrame intercepting keystrokes - comp.lang.java.gui... the JFrame respond to certain key-strokes.. ie. ctrl-1, f1, etc, etc? Similar to how a menu item ... right way to do it when you're using Swing components. I'd like to add ... Adding simple database, excel export, and reports with D4 Pro ...... the skeleton & glue to do what they say (with Add, Items ... forcing it to work than just learning how to use the ... When you run the Ortmaster.exe program, use the menu ... Running 49g libraries on 50g - comp.sys.hp48... into the library menu and push the soft menu key ... don't know if Google Groups (which I'm using ... read "Caution: For Indoor or Outdoor Use Only". I could add two ... How to Choose Report layout based on field validity - comp ...(and yes, I have to admit I'm a dunce when it comes to using them, I wish I ... Checking the key field should work, as there ... on field validity - comp ..... pop up menu for ... How to Use Menus (The Java™ Tutorials > Creating a GUI With JFC ...A mnemonic is a key that makes an already visible menu item be ... with a menu item was to use menu's add(Action) ... associated with the menu item. See How to Use ... WordPress Menu Tricks | ThemeShaper... how to use Primary and Secondary menus in your WordPress theme; Add descriptive sub-title links to your menu items like ... menu' ); The key in ... menu add_action( 'init ... 7/17/2012 8:58:48 AM
|