Hot answers tagged

15

Intro One day I was playing with Developer` package and found DateSetter which uses some kind of floating elements that I found useful. After taking a look at a source code I found out it was FrontEnd`AttachedCell. From the code one could learn enough to create something useful: Usage FrontEnd`AttachCell[ parentObject, (*Box or Cell ...


10

Converting the Algebraic Manipulation palette into a DockedCells: CurrentValue[EvaluationNotebook[], DockedCells] = Append[MapAt[Partition[Flatten[#], 9] &, Import[FileNameJoin[{$InstallationDirectory, "SystemFiles", "FrontEnd", "Palettes", "Other", "AlgebraicManipulation.nb"}]][[1, 1]], {1, 1, 1}], ButtonBoxOptions -> {BaseStyle ...


7

Something like this might help: SetOptions[EvaluationNotebook[],DockedCells-> Cell[BoxData[ToBoxes[DynamicModule[{m=1},Panel[Slider[ Dynamic[m,SetOptions[EvaluationNotebook[],Magnification->(m=#)]&],{0.5,2.0}], "Magnification"]]]],"DockedCell"]] It puts a magnification control into a docked cell at the top of the notebook window.


7

On a Linux pc, the relevant file is in a place like this one: /usr/local/Wolfram/Mathematica/10.1/SystemFiles/FrontEnd/TextResources/X/MenuSetup.tr To edit the file, one needs administrator rights, i.e. modify it under sudo. Since introducing errors can make Mathematica no longer usable, first make a backup copy of the original file before trying to ...


7

Adding the functionality of the Algebraic Manipulate palette to the context menu ("right click menu") of Mathematica The commands of the Algebraic Manipulation palette are converted into MenuItems, that will mainly use the FrontEnd, with MenuItem[#[[1, 1]], FrontEndExecute[{ FrontEnd`NotebookApply[FrontEnd`InputNotebook[], #, All], ...


6

Yes, it is possible. Evaluate $InstallationDirectoryand from there open the directory $InstallationDirectory\SystemFiles\FrontEnd\StyleSheets. Make there a folder, say, entitled "Custom" and place your favorite StileSheets into this folder. Done. The folder will appear in the Menu/Format/StileSheet. Later edit: One another way is as follows: go to ...


6

As of version 9, MenuItem now takes the Method option, similarly to Dynamic and Button. Which means that you can make it a "Queued" evaluation. To demonstrate: FrontEndExecute[ FrontEnd`AddMenuCommands[ "Open", {MenuItem["Delayed New", System`KernelExecute[Pause[10]; NotebookCreate[]], System`MenuEvaluator -> Automatic]}]] Here we have a ...


5

EDIT As rasher observes my answer does not answer your direct question. Tooltip wrapper does not appear to work for ListPicker items. I posted this answer in the event it achieves your aim or motivates your own answer. I am not certain what your ultimate aim is. I have modified your code (esp. avoid uppercase variable names to avoid conflicts with ...


5

You cannot directly do that from the Window > Zoom menu option. However, you can use the following to zoom selections at other magnification levels. The following code creates a palette that lets you magnify a selection in your notebook between 50% to 300% in steps of 10. DynamicModule[{zoom = 1}, CreatePalette[Column@{ "Custom zoom", ...


5

Since you reference the Window > Magnification menu I think you are describing zoom for the entire Notebook. You can set magnification in 10% increments by holding Ctrl and rolling the mouse wheel up or down. By first setting the Magnification to 125% you get 115%, 135% etc, and you can therefore select magnification down to 5% granularity very ...


4

You want to use PopupMenu: PopupMenu[a, {a, b, c, d}] Note, if you want it to be dynamically linked to a variable, use: PopupMenu[Dynamic[x], {a, b, c, d}] Then, x takes the value given by the drop down menu:


3

I have a partial answer to my question. In order to add menu items, e.g., to submenus of the Format menu for Mathematica version 10.0.1. What to put in the init.m FrontEndExecute[ AddMenuCommands["BackgroundDialog", {Delimiter, MenuItem["Linen",Background->RGBColor[0.980,0.941,0.902]], MenuItem["AliceBlue",Background->RGBColor[0.941,0.973,1.0]], ...


3

Solution: Murta 16 mins ago: I have this same problem on Win Machine in the company I work with MMA 9. Alt+/ do not work. One curiosity, are you admin in this machine? In my home windows I have no problem with Alt+/ in MMA 9. One detail that is different, my menu works, just shortcuts no. @Murta: I confirm that launching Mathematica 9 as ...


3

nb = CreateDocument[{TextCell["test", "Section"], ExpressionCell[test, "Input"], TextCell["test"], TextCell["head one", "Section"], TextCell["test", "Section"], ExpressionCell[Sin[x], "Input"]}] You can use NotebookFind on a subset of cells. If[SelectionMove[#, Before, Cell]; NotebookFind[#, "test"] =!= $Failed, #, Nothing ] & /@ ...


2

An even better version than the one above from me: Paste between the defintions of Palettes and Window: Menu["Page&Breaks", { MenuItem["ShowPageBreaks ON ", ShowPageBreaks->True, Scope->NotebookDefault], MenuItem["ShowPageBreaks OFF", ShowPageBreaks->False, Scope->NotebookDefault], Delimiter, ...


2

Here's a guess at what you're after, although I think b and c are switched. a = "Algebraicas"; b = "Trigonometricas"; c = "Tercer Grado"; y = w + 1; Manipulate[ Plot[selection, {x, -5, 5}], {type, {a, b, c}, ControlType -> PopupMenu}, {selection, Dynamic[type /. {a -> {Sqrt[x] -> TraditionalForm[Sqrt[x]], x^2}, b -> ...


2

Token That this menu item is doing is: FrontEndExecute[FrontEndToken[InputNotebook[],"GenerateNotebook"]] Keep in mind you have to add there FrontEnd` context. You can use it in other palette after previously setting focus on different one. Or you can put it in joker.m from 68871 Or use as a manual function for any NotebookObject in place of ...


2

Please try using this: FrontEndExecute[ FrontEnd`AddMenuCommands[ "MenuListQuitEvaluators", {MenuItem["AddMenu &Quit", "EvaluatorQuit", MenuKey["q", Modifiers -> {"Control"}], System`MenuEvaluator -> Automatic]}]] For version 10.0.0 under Windows using the menu item added by this does not crash the front end.


2

Mathematica ships with it's own Qt libraries. Consider replacing them with the system libraries, then it probabily fits nicely into the Ubuntu layout. This guide will probabily also workk with newer Mathematica versions: http://homepage.uibk.ac.at/~c705283/archives/2010/03/29/mathematica_7_qt_style/index.html


2

Not sure what you're asking. Just in case: r1 = SetAccuracy[9.87654321012345678, 18]; {PopupMenu[Dynamic[x], {1 -> 1, r1 -> r1}], Dynamic@x}


1

As MarcoB pointed out, Evaluate-In-Place Ctrl+Shift+Enter on ColorSetter[] gives an input object that when clicked brings up the menu color palette. However, if you're putting this inside a plot (or PasteButton) you must use a dynamic function. For putting it in plots use PlotStyle -> DynamicSetting[ColorSetter[]]. Thanks, MarcoB.



Only top voted, non community-wiki answers of a minimum length are eligible