Hot answers tagged

21

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]], {...


9

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 ...


9

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 ...


8

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 $...


5

You may use functions from the Low-Level Notebook Programming guide. ClearAll[evaluateFromFirstCell]; SetAttributes[evaluateFromFirstCell, {HoldFirst}]; evaluateFromFirstCell[nb_NotebookObject : EvaluationNotebook[]] := Module[{cells = Reverse@PreviousCell[EvaluationCell[], All, CellStyle -> "Input"]}, Scan[ SelectionMove[#, All, Cell]; ...


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 in-bulit ...


5

In Windows Preferences is under the Edit menu:


4

This is potentially useful info from a scrape I did building on this. The alignment position can be an Offset spec too, a la: MathLink`CallFrontEnd[ FrontEnd`AttachCell[EvaluationCell[], Cell["wheee"], {Offset[{10, -71}, 15], {Left, Bottom}}, {Left, Top}, "ClosingActions" -> {"SelectionDeparture", "ParentChanged", "EvaluatorQuit"}] ...


4

Running on a Raspberry Pi 3 ... ParallelEvaluate[$KernelID] {1,2,3,4} The following launches the Parallel Kernel Status window and runs a simple evaluation that utilizes 100% of the proccesor's 4 cores: Parallel`Palette`menuStatus[] ParallelEvaluate[Timing[Inverse[RandomReal[{-1, 1}, {1000, 1000}]]; {{21.62, Null}, {21.94, Null}, {22.67, Null}, {22....


4

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 ...


3

You can open "Preferences" dialog programmatically with: FrontEndExecute[FrontEndToken["PreferencesDialog"]]


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 administrator ...


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, MenuItem["...


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 -> {x^...


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

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

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


2

Please try this from John Fultz via MathGroup Archive. FrontEndExecute[FrontEnd`ResetMenusPacket[{Automatic}]]


2

A possible solution which worked for me (running Fedora v30) can be found on the Wolfram community forum. There, you want to navigate to the directory containing your Mathematica executable and run: QT_AUTO_SCREEN_SCALE_FACTOR=1 QT_SCALE_FACTOR=1.33 ./Mathematica & Depending on your screens resolution you may need to adjust these values. If you're ...


2

Seems like there is a programmatic way to create a "Run all above", as described in answers this question about selection of above cells.


1

Here is a first attempt that should get you started: action[expr_] := Module[{old}, old = InputNotebook[]; SetOptions[old, Visible -> False]; With[{old = old}, CreateDocument[{expr, Button["Close", {NotebookClose[InputNotebook[]], SetOptions[old, Visible -> True]}]} ]] ]; DynamicModule[{}, Grid[{{...


1

I've got the same problem (mathematica 12, Linux Mint Mate 20) without any solution. Just now I installed version 12.1.1 and the method with file ~.Mathematica/FrontEnd/frontend.css is working now! Content of this file: * { font-size:16pt; font-family:"Griffy"; }


1

The solution is to change: "New Option" :> PTX[], by "New Option" :> MessageDialog@PTX[], Thanks to Kuba.


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