# Tag Info

34

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

30

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[]] := ...

24

If you want readline-like behavior you can of course use a readline wrapper. This works on all operating systems. On Ubuntu Linux (and other distributions I'm sure too) it can be installed easily through the package management. On Max OSX this can be installed using for instance MacPorts and I'm sure, there is an easy option on Windows too. Anyway, on all ...

23

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

21

If you are serious about using this extensively, consider making a function based on CreateDocument... Here is one way to pursue Szabolcs's line of thought. What follows is a function based on CreateDocument[] that can be used in conjunction with the (now somewhat neglected) option DisplayFunction, which handles where the output of graphics functions ...

18

If you're on Windows: which command line interface are you talking about? The "math.exe" program is a console mode (i.e. "DOS prompt") interface to the Mathematica kernel. If you use that, you have access to the standard Windows console command-line editing; it is automatically provided by the OS to all console mode programs. You can use the arrow keys to ...

17

You can always create a new notebook and put things in it. If you are serious about using this extensively, consider making a function based on CreateDocument that sets the appropriate options for the notebook to look good. Check what CreateDocument@Plot[Sin[x],{x,0,10}] does. Or use a quick-and-dirty hack based on CreatePalette: fig = CreatePalette[#, ...

16

I found the solution. Mathematica is set up to use the font KLIpIqaDmey. The tip-off is in the UnicodeFontMapping.tr file referenced in the question. The header reads: @@resource UnicodeFontMapping Mathematica: Times Automatic Mathematica: (Times Courier) Automatic Mathematica: (Mathematica1 Mathematica1Mono) Automatic Mathematica: (Mathematica2 ...

14

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

13

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

12

There's also a way to do it programmatically with LineBreakWithin SetOptions[$FrontEnd, LineBreakWithin -> False] Recover the original with: SetOptions[$FrontEnd, LineBreakWithin -> Automatic] Warning: This function has not been fully integrated into the long-term Mathematica system, and is subject to change.

12

You can also set option PageWidth -> Infinity for the Cell or Notebook, e.g.: SetOptions[EvaluationNotebook[], PageWidth -> Infinity]

11

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[#]&...

11

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

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

9

This is because you are using = (the assignment operator) in the condition (not the body) of While. It is a typical beginner mistake to use = where == is meant, so Mathematica warns about this. Since you also use several ; in the condition, it gets a little confused and only highlights one of the = signs, not all of them.

9

I don't think the answer is related to choosing $OperatingSystem or SystemInformation as in Mr.Wizard's and F'x's answers (although both are cleaner than using$Version). I'm guessing you created your file on your PC and then opened it in your Mac. Tooltip then shows you the cached result from your PC. To make the tooltip refresh on your other machines, ...

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

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 = Runtime`getRuntime[]; process = ...

9

Writing games using dynamic interactivity in mathematica is an amusing subject! I will vote up your post for this. But I agree with others that it is hard to answer your question, you should work out minimal example for us first. Below I am giving my code for tetris. I recognize, it is a nonminimal answer, but it is working and can be useful for you. ...

8

Perhaps the simplest way is to introduce a global variable storing the Manipulate variables: Manipulate[ global = {A, f, p}; Plot[A*Sin[f*t + p], {t, 0, 2 Pi}, PlotRange -> {{0, 2 Pi}, {-1, 1}}], {A, 0, 1}, {f, 1, 10}, {p, 0, 2 Pi}] From now on, we can query global in a different cell any time. If wrapped into Dynamic, it will be updated as the ...

8

If you just want A, f, and p dynamically displayed all the time and printed when desired then: Manipulate[ Column[{ Row[{Button["print", CellPrint[ TextCell[Grid[{{"A =", A}, {"f =", f}, {"p =", p}}], "Text", ShowStringCharacters -> False]]], {A, f, p}}], Plot[A*Sin[f*t + p], {t, 0, 2 Pi}, PlotRange -> {{0, 2 Pi}, {-1,...

8

Let's see if now I got it better... DynamicModule[{var = False}, Dynamic@Column[{PopupMenu[ Dynamic[var], {False -> #, True -> "Add another Menu"}], If[var, #0["new menu"], ## &[]]}]] &["one menu"]

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

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 been using for a while to add some features I realised were missing (which brought me to look how ...

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:

8

There is a setting in the Global Preferences: Notebook Options | Window Properties | WindowTitle | "FullFileName"

7

You could use this NumberForm[2.601519253*10^-8, {16, 16}, ExponentFunction -> (If[-10 < # < 10, Null, #] &)] (* 0.0000000260151925 *) Export into CSV format could be done as follows: Define a function numFormat[y_] := ToString@NumberForm[y, {16, 16}, ExponentFunction -> (If[-10 < # < 10, Null, #] &)] create a few ...

7

How to format Using AccountingForm : I show first the output of one function for your number n = 2.60152*10^-8 (*your number *) padIt[n, {15, 14}] (* +0.00000002601519 *) the first parameter is the number to format, then there is a list of 2 numbers. The first is the total number of digits you want in the field. The second number is how many digits ...

7

You could try something like: y = 0; b1 = Button["Evaluate", y = Cos[Pi/6] (++y), Method -> "Queued"] Dynamic@y

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