I want to create a standalone mathematica executable. I would like to have some view capabilities like CreateDialog or TabView or those kinds of things. I would like my users to have an interface to input dynamic strings and variables.

I want to do something like this:

function = TabView[{
   "General" -> Column[{
      Row[{TextCell["Project Name:"], InputField[Dynamic[proj]]}],
      Row[{TextCell["Number of Inputs:"], InputField[Dynamic[num]]}]
   "Another Tab" -> Plot[x^2, {x, 0, 10}]
   }, ControlPlacement -> Left]

Anyone familiar with this process?

  • 3
    $\begingroup$ It can't be done in a standalone executable. The presentation of these expressions is the responsibility of the front end, so you either have to write your own interface or use the CDF player, which (I think) includes the normal FE. $\endgroup$ – Oleksandr R. Aug 27 '12 at 16:18
  • 2
    $\begingroup$ I have often wished for this too! The ability to export mathematica dynamic gui code into html5 would be awesome. $\endgroup$ – M.R. Aug 27 '12 at 16:32
  • 2
    $\begingroup$ mathematica.stackexchange.com/questions/1096/… $\endgroup$ – M.R. Aug 27 '12 at 16:41

A link was posted in comments that gives the full list of compilable functions in Mathematica 8. If you look at this list, you'll see in particular that there are no *View, no *Dialog and no Input* functions in this list. No user interface element can be compiled to C code or standalone executable in Mathematica.

The reason for this is straightforward: all user interface depends on the Mathematica front-end, i.e. the application you see running. Standalone applications don't link to the Mathematica front-end, so they can't include UI. In fact, if they did link to the Mathematica front-end, they would not be standalone executables anymore, because you would need to redistribute the front-end in some way along with the executable. Fortunately, there is another way to do this, through the use of the CDF player which allows you to create full-fledge Mathematica notebooks (including user interface) that will run on computers without the full Mathematica installation. Another possibility is to link you compiled Mathematica code with OS-specific UI functions using the OS native UI elements (or a cross-platform toolkit, like Qt, Gtk, FLTK, …).

  • $\begingroup$ Thanks so much. This was very helpful. :) $\endgroup$ – tquarton Aug 28 '12 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.