# Tag Info

40

Double click the output cell instead EDIT: From murrays comment: tutorial/WorkingWithCells: "To specify which cells remain visible when the cell group is closed, select those cells and double-click to close the group."

38

Date-picker implementation in Mathematica The following is my implementation of a simple date-picker. The current date is highlighted in LightBlue and the weekends are highlighted in LightGreen. The selected date is always highlighted in LightRed (the default selection is the current date). You can tap into this calendar by using the Dynamic values for year, ...

35

This code is not generalized. It has been written for a specific problem but you can take it and should be able to make it a more general function -- add flexibility (e.g. add grid options) or tailor it to your needs. ClearAll[frozenPaneGrid]; Options[frozenPaneGrid] = {"RowLabelSort" -> False}; frozenPaneGrid[tl_, tr_, bl_, br_, OptionsPattern[]] := ...

28

You can create a palette to show/hide all the input cells in the selected notebook. CreatePalette[ Column[{ Button["Hide code", { NotebookFind[SelectedNotebook[], "Output", All, CellStyle]; FrontEndExecute[FrontEndToken[SelectedNotebook[], "SelectionCloseUnselectedCells"]] }], Button["Show code", ...

24

I don't think you can do this. As an alternative, you can have a palette with all the Mathematica windows for easy switching. Something like this quick hack: CreatePalette[ Dynamic@Column[ Button[ "WindowTitle" /. NotebookInformation@#, SetSelectedNotebook@# ] & /@ Notebooks[]]] To remove the palette window itself from the notebook ...

20

There is a built-in DateSetter: {DeveloperDateSetter[Dynamic@date], Dynamic@date} By default the first selectable date is tomorrow and one can only go to future months. However, the option NotebookToolsDateSetterRange can be used to set the first selectable date to sometime in the past, {DeveloperDateSetter[Dynamic@date, NotebookToolsDateSetterRange -&...

17

Yes! It is possible, although it takes some spelunking. Upon some searching with Names, I came across three relevant contexts where the predictive interface functions live: PredictiveInterface, PredictiveInterfaceDump, and Predictions. This last one is where the action happens. Luckily, the symbols were only ReadProtected, and their source code was ...

15

Here is the summary: There is no shortcut (you can suggest here) Quick close/open labeled minimize below Disable from Top Menu >> Edit >> Preferences...

14

This cannot be answered very well without knowing your C++ library much better. As you said, you have a choice between MathLink and LibraryLink. Generally, I recommend LibraryLink because: It runs in the same process, and data transfer is much faster than with MathLink It provides features that MathLink does not have, such as direct manipulation of packed ...

13

Easy! Just set Progress$ConsoleSupport=True. You can set this in your init.m and have it always on. Now, the usual word of warning about undocumented functionality: it may change or break in the future, erase your hard-drive, or cause a global pandemic. Use with appropriate caution. Why did we hide such an awesome feature behind a flag? Because we didn'... 12 Here is one that should work in version 6 and later. The full code is at bottom. Here is what it looks like: {dateSetter[Dynamic[d]],Dynamic[d]} I did not incorporate the year here, but you could put it in a Tooltip or add it to the button's graphic. And when you click on the button you get Incorporate this into a Manipulate using {d,dateSetter[#]&} ... 12 This is my solution to the problem. I keep an object at the root level which keeps track of which lists are open and which are closed. That way when a list is opened I can open it in the right state. For me, this is not a satisfactory solution because it's much slower than using OpenerView. OpenerView doesn't recompute its values when a branch is closed and ... 11 Prior to version 10 of Mathematica, there was a menu option Evaluation / Interrupt Evaluation... with the hot-key ALT-, (comma). This would temporarily suspend the current evaluation in progress. The bad news is that this menu item is gone. The good news is that the hot-key still works in versions 10 and 11. The sequence of events is as follows: Start a ... 10 In version 9: suppose nb is your notebook object (this can be nb=EvaluationNotebook[], but if you're going to be closing input cells you probably want to have an auxilary notebook a choose the correct notebook from Notebooks[]). Then, to close all the Input cells, for example, do cells = Cells[nb, CellStyle->"Input"] SetOptions[#, CellOpen -> False] &... 10 I have to do this all the time. I only have an annoyingly manual way to solve this. On a mac, Alt-click on the cell marker on the right for an InputCell containing the code, this should select ALL input cells. Then go to the Cell -> Cell Properties menu at the top and unselect the Open item. All the input cells should hide. On the right there should ... 10 Please note: these functions have been updated with some more functionality, here: See my answer here Very old thread but, since the question is formulated in a general way, I thought it could be updated with other approaches. It would be interesting to see more contributions to the topic. Below is my one cent. I have just extended the function that I have ... 10 I would say JLink is one of the fastest ways to do this. Just use the Runtime to start a process executing your command and collect the exit code too: << JLink RunThroughWithExitCode[cmd_String] := JavaBlock[Module[{ireader, istream, runtime, process, reader}, LoadJavaClass["java.lang.Runtime"]; runtime = RuntimegetRuntime[]; process = ... 10 Go to Format -> Edit Stylesheet Under "Choose a style" choose "Output" Select the cell bracket of the new cell that appears Press Ctrl+Shift+E (Command+Shift+E on a Mac) to show the cell expression Change Cell[StyleData["Output"]] to Cell[StyleData["Output"], ShowCellLabel -> False] Press Ctrl+Shift+E again Close the stylesheet window 10 I started on this, after building out a search paclet for this answer. The basic idea is to simply provide nicer access to the basic underlying paclet. The code all lives here. We can use it like so: Get["https://raw.githubusercontent.com/b3m2a1/mathematica-tools/master/SearchBrowser.wl"]; SearchBrowser[] And then just type and search: One convenient ... 9 The answer is that yes, you can affect the appearance of components of a control but the problem in this case is that your list of appearances appearances = {"DialogBox", "Palette", "FramedPalette", "Frameless"}; are only valid Button appearances and that is why they have no effect of ButtonBar or TabView. When you use valid appearances it works fine: ... 9 For those who will encounter the same problem as mine (and OP's), I added this answer. Mathematica now(since 10.0.0) has a new built-in function called RunProcess which does exactly what OP asked (including the standard error). 9 This is perhaps not a completely satisfactory solution but it is Mathematica based. Unlike MessageDialog[] SystemDialogInput["FileSave"] will make the Taskbar icon flash in Windows and the Dock icon bounce in Mac OS X under certain conditions. (I believe the document must be minimised in Windows or hidden in Mac.) Of course it has the slight side-effect ... 9 The expression that generates that GUI element is contained in the file: FileNameJoin[ {$InstallationDirectory, "SystemFiles", "FrontEnd", "TextResources", "ColorSchemeSelector.tr"}] After making a back-up you can edit that file as you see fit. I don't have time to dig into it now and make a nice improvement but I confirmed that editing works by ...

9

Quick fix for a specific file: Ok, let's open new package File -> New -> Package. It was second on my list of Notebooks[]. So: package = Notebooks[][[2]] This is a notebook as any other, it just has different stylesheet ("Package.nb") and we can modify it as any other: SetOptions[ package, { StyleDefinitions -> Notebook[{ Cell[StyleData[...

9

The simplest way is just data = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}}; InputField[Dynamic[data]] Dynamic[data] {{1, 2, 3, 4, 55}, {6, 7, 88, 9, 10}}

9

9

I do this differently to @MB1965. SetOptions[$FrontEndSession, MenuConfigurationFile -> "path/to/alternative/MenuSetup.tr" ]; and then to restore the menus: SetOptions[$FrontEndSession, MenuConfigurationFile -> Inherited ]; I find this easy and can be done readily on the fly, switched on and off with buttons etc.

9

Here's a stylesheet version that mimics Kuba's code: With[{cv := CurrentValue[EvaluationCell[], {TaggingRules, "LastCursorPosition"}]}, SetOptions[EvaluationNotebook[], StyleDefinitions -> Notebook[ { Cell[StyleData[StyleDefinitions->"Default.nb"]], Cell[StyleData["Input"], ...

8

You can always create your own custom controls. This is a lot of work, but it also gives you unlimited flexibility. You can even create completely new kinds of control. Scroll down to the last section here to see an example. If you're aiming for a custom TabView-like control, I'd start with PaneSelector. Here's a primitive example (just a start, not ...

8

I don't know whether I interpret your question correctly but have you checked Preferences->Appearance? There you see what the colors of the syntax highlighter mean:

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