Tag Info

Hot answers tagged

14

Edit > Preferences > "Advanced" tab > Open Option Inspector In the Option Inspector's sidebar, drill down to Notebook Options > Window Properties. For the WindowElements option, uncheck "StatusArea" and "MagnificationPopUp". Here's what your Option Inspector should look like:


12

Does the following work as needed? CreateDialog[ TabView[ {"General" -> Column[{Row[{"Project Name:", InputField[Dynamic[project]]}], Row[{"Number Of Wells:", InputField[Dynamic[num]], Button["Set", DialogReturn[num]]}]}], "Row Selection" -> Dynamic@Column[ Table[Row[{"Well " <> ToString[i] <> ...


9

This is all you need: Button["Press Me", Print[ChoiceDialog["OK or Cancel?"]], Method -> "Queued"] Without the queued method the choice dialog clashes with the button, which is in preemptive mode by default, meaning it tries to run as the foremost process. It also works fine in a dynamic module.


9

Not 100% solution, but this may work. Define: dialog := CreateDialog[{TextCell["Click OK to close"], DefaultButton[]}, Modal -> True, NotebookEventActions -> {"WindowClose" :> dialog}] Then call: dialog At least, it reappears :)


8

SystemDialogInput["FileSave"] will do this for you. Something like fileName = SystemDialogInput["FileSave"] If[fileName != $Canceled, Export[fileName, myData]] should do the whole trick. The fire extension determines the type of export (if MMA knows it and supports it). Preselecting a directory path and filtering allowable file extensions can be done as ...


8

The behaviour is indeed inconsistent: CreateDialog uses the option WindowSize -> All, where All (god knows why) causes the unexpected behaviour with dynamic content. See resolution of the problem at the end of the post. The following even more simple example clearly shows that something fishy is going on: only path2 can be set via the second button but ...


7

Here is one solution:- CreateWindow[DialogNotebook[{TextCell["Number of Stations: "], PopupMenu[Dynamic[ns, ( ns = #; (* set default values *) Function[n, (x[n] = 0)] /@ Range[ns]; col = Column[InputField[Dynamic[x[#]]] & /@ Range[ns]]) &], Range[2, 8]], TextCell["Sound Frequency (kHz): "], Dynamic[col], ...


7

To make it work, use Button["run file 1", NotebookEvaluate["/../file1.nb"], Method->"Queued"]


7

What really makes Dialog a model dialog is: WindowFrame -> "ModalDialog" (*or*) WindowFrame -> "MovableModalDialog" So be careful when changing WindowFrame with the expectation that your dialog will remain modal. Funny proof is that the following: CreateDialog[DefaultButton[], WindowFrame -> "ModalDialog", Modal -> False] is a modal ...


7

it is not etirely clear for what you need that, but I think the best way to store data within a Notebook so that it is available in the next session is the TaggingRules option. This is how you could store data for a there: CurrentValue[EvaluationNotebook[],{TaggingRules,"dataset-name"}] = data; And this is how you can read it: data = ...


5

The following works for me with Mathematica 8.0.4 DynamicModule[{switch = 1}, CreateDialog[ globalvar = DocumentNotebook@TextCell@Dynamic@Switch[switch, 1, "A", 2, "B"], WindowSize -> {200, 100}]]; However making the variable local to the DynamicModule does not work: DynamicModule[{switch = 1, localvar}, CreateDialog[ localvar = ...


5

Add False as a second argument to FrontEndToken for "Revert": FrontEndExecute[FrontEndToken["Revert", False]]


5

Try this: SystemDialogInput["FileOpen", {"Data", {"Data" -> {"*.data", "*.dat"}}}] The doc page for SystemDialogInput describes under "More Information" how to create new file types by listing the patterns they match.


5

SetOptions[InputNotebook[], "DockedCells" -> None]


5

Since all windows in Mathematica are basically Notebook objects (notebook windows, palettes, dialog windows, etc.), one can use the more general CreateWindow[DialogNotebook[...]] approach, which is a bit more customizable than CreateDialog. The other option is to use the more specific Dialog function, but it is rather limited when it comes to designing a ...


4

I don't think this is a difference between Mathematica and the Player Pro but between Mathematica 8 and 9. For me Mathematica 8 brings up the same dialog as Player Pro 8, while Mathematica 9 brings up something slightly different (my interpretation is that WRI has improved the automatic behavior, I'm not sure whether I'd call the old behavior to be wrong or ...


4

In the comments celtschk suggested Button[..., Method -> "Queued"] and Christina confirmed it as a solution.


4

Updated: It seems like this bug has been ironed out in version 9. as it does not cause a crash anymore. Instead of comments, let's gather here the information we have: Crash happens on Mathematica 8.0.0.0 through 8.0.4, seemingly on all OS (reported confirmed on: WinXP/32, Mac OS 64-bit, Ubuntu 64bit, Win7/32). Mathematica 7 doesn't crash, at least on ...


4

As Rojo has pointed out, Method -> "Queued" can be used for the Button to wait for the dialog to appear, be evaluated, and return. I assume you want to use the value of name in some outer computation, so I forwarded it via a DialogReturn and therefore it is made global (while name inside DialogInput is local). Note that DialogReturn is the standard way to ...


4

My approach to this task would be to create new Input Cells within the notebook, that have the same structure as newly typed in symbol definition. createNewSymbol[] := Module[{importFileName = SystemDialogInput["FileOpen", ".txt"]}, With[{importedData = If[StringQ@importFileName, Import[importFileName, "Table"]], symName = ...


3

Just replacing the DynamicModule in the right place may help... CreateDialog[DynamicModule[{switch = 2}, DocumentNotebook@TextCell@Switch[switch, 1, "A", 2, "B"]], WindowSize -> {200, 100}]; or (see the comments below) DynamicModule[{switch = True}, CreateDialog[TextCell@{Dynamic@Switch[switch, True, "A", False, "B"], ...


3

You need the values of the options "WindowTitle" and "ModifiedInMemory". These can be obtained using the function NotebookInformation. For notebooks that have not been modified since the last save the value of the option "ModifiedInMemory" is True. So, you can do: {"WindowTitle", "ModifiedInMemory"} /. (NotebookInformation /@ Notebooks[]) to get all the ...


3

If what you are looking for is the ability to halt access to the notebook (or the Mathematica front end in general), then you want to set Modal->True in the MessageDialog options. MessageDialog["Click to Continue", Modal->True] As mentioned in the comments, Model does not appear to be a valid option for MessageDialog; however, it works. It does ...


3

Dialogs are notebooks with different from regular options settings, so you can export save them as you want: (that is the case with palettes too) Export[ FileNameJoin[{$TemporaryDirectory, "myDialog.nb"}], CreateDialog[ Column[{ InputField[Dynamic[a], Number, FieldHint -> "enter a"], InputField[Dynamic[b], Number, FieldHint ...


2

Another way to get around the fact that the kernel will block until DialogReturn is evaluated is to use Method -> "Preemptive": DialogInput[{TextCell["Choose your folder:"], InputField[Dynamic[x]], FileNameSetter[Dynamic[x], "Directory", Method -> "Preemptive"], DefaultButton[DialogReturn[x]]}]


2

Mathematica "freezes" until you press the dialog return. This is by design for DialogInput as far as I know. So instead use CreateDialog CreateDialog[{TextCell["Choose your folder:"], InputField[Dynamic[x]], FileNameSetter[Dynamic[x], "Directory"], DefaultButton[]}]


2

In Mathematica catalog, in subfolder TextResources you'll find a file called MiscExpressions.tr. Simply replace "StudentBar"-> Cell[BoxData[...]] with "StudentBar"-> Cell[] There are two things to remember though: This might not be a legal thing to do. It's best not to modify the original file, instead save the modified file in your ...


2

Somehow turning on Selectable does what you need: DialogInput[Graphics3D[Cuboid[]], Deployed -> False, Selectable -> True]


2

CreatePalette[InputField[Dynamic@x], WindowClickSelect -> True] Edit As reported by @AlexeiBoulbitch (see comments), this solution seems not to work for Windows OS (it does work for me on OS X, v10.0.2). I actually found a duplicate post which already mention the problem 3 years ago ... This post also gives the following workaround : ...


2

Perhaps: f[aa_, oo_, pp_] := CreateDialog[ Column[{Manipulate[ Plot[(aa = amp) Sin[(oo = omega) t - (pp = phi)], {t, 0, 10}], {amp, 0, 1}, {omega, 1, 10}, {phi, 0, 2 Pi}], DefaultButton["Close", DialogReturn[]]}], Modal -> True]; Dynamic[{a, o, p}] f[Unevaluated@a, Unevaluated@o, Unevaluated@p]



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