Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
2  
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. –  Oleksandr R. Aug 27 '12 at 16:18
2  
I have often wished for this too! The ability to export mathematica dynamic gui code into html5 would be awesome. –  M.R. Aug 27 '12 at 16:32
2  
add comment

1 Answer 1

up vote 2 down vote accepted

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, …).

share|improve this answer
    
Thanks so much. This was very helpful. :) –  tquarton Aug 28 '12 at 23:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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