MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: InitializationCell -> Toggle shortcut key

  • To: mathgroup at smc.vnet.net
  • Subject: [mg56790] Re: InitializationCell -> Toggle shortcut key
  • From: "Carl K. Woll" <carlw at u.washington.edu>
  • Date: Fri, 6 May 2005 02:59:58 -0400 (EDT)
  • Organization: University of Washington
  • References: <d5ctpl$me6$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

"Trevor Baca" <trevorbaca at gmail.com> wrote in message 
news:d5ctpl$me6$1 at smc.vnet.net...
> mathgroup,
>
> i'd like to create a keyboard shortcut to toggle initialization cell
> status.
>
> reading through the archives and studying a post from paul hinton, i
> edit the file KeyEventTranslations.tr (deeply buried in the filesystem)
> to include the following line:
>
> Item[KeyEvent["i", Modifiers -> {Command, Control}], InitializationCell
> -> Toggle]
>
> i save, restart, and blow up. (something about a syntax error on line
> 52 of the file that reads \tItem[KeyEvent[\".)
>
> my intuition of what's wrong is that i stole the InitializationCell ->
> Toggle bit from MenuSetup.tr in the same directory and that a rule like
> that won't do as the second argument to Item[ ]; my guess is that i'll
> need a three-part FontEndToken[ ] object to pass into the second
> position of Item[ ], but i haven't a clue as to what the correct
> structure for that FrontEndToken[ ] would be.
>
> anyone have any suggestions on formulating an initialization cell
> toggle Item[ ] for KeyEventTranslation.tr?
>
> trevor.
>

I can't tell you what front end commands to use for your problem, but I have 
a suggestion. Have you thought about adding the line

Item["&Initialization Cell", InitializationCell->Toggle]

somewhere in the file PopupMenuSetup.tr. If you do so, then you can click on 
the cell bracket you want to toggle, and then right click to get the popup 
menu (in Windows), and then select Initialization cell.

Carl Woll 



  • Prev by Date: Re: ZTarnsform[Sin[4 n],n,z] OK, but ZTransform[Sin[5 n],n,z,] hangs?
  • Next by Date: Re: how call a function by same name in 2 different contexts?
  • Previous by thread: Re: InitializationCell -> Toggle shortcut key
  • Next by thread: Re: InitializationCell -> Toggle shortcut key