Wolfram ResearchPRODUCTSPURCHASEFOR USERSCOMPANYOUR SITES

Documentation  / Solutions  / GUIKit  / Running GUIs  /

Executing GUIs

One of the most basic features of GUIKit is loading and executing an existing user interface application. This can be accomplished in one step in either a modal or modeless session with the Mathematica kernel using GUIRunModal or GUIRun.

Load the GUIKit` package before calling any GUIKit functions.

In[1]:=

Here we load and execute an example user interface for a simple calculator that uses the Mathematica kernel for the calculations and, on closing, returns the results to the kernel.

In[2]:=

Out[2]=

Here is a screen shot of what the previous interface would look like on a typical platform.

The GUIKit functions will search a path defined by the symbol $GUIPath to discover user interfaces so that only a short path to the definition is necessary.

Here is another example that provides an input dialog for entering angles. With both examples, a modal session with the kernel is initiated so that control and the result is only returned to the kernel when the user is finished.

In[3]:=

Out[3]=

Here is a screen shot of what the previous user interface would look like on a typical platform.

We are also free to execute an interface in a modeless fashion. Executing the previous calculator example again with GUIRun immediately returns control to the kernel, but the calculator window continues to function. Also note that in a modeless session there is no way for the interface to return a custom result to the kernel when closed as the result value of the call to GUIRun.

In[4]:=

Out[4]=

In the next two sections we explain the GUIObject expression that is returned from GUIRun and discuss some features of working with modeless windows. We will also discuss a technique of delaying the execution of the user interface, even if used with a modal session, so that we can customize its features before presenting it on screen.



Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information


 © 2009 Wolfram Research, Inc.  Terms of Use  Privacy Policy |
Sign up for our newsletter: