💾 Archived View for blitter.com › apl-books › APLX50 › APLX-manual › www.microapl.com › apl_help › c… captured on 2023-01-29 at 14:38:08.
⬅️ Previous capture (2022-07-17)
-=-=-=-=-=-=-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE>Using System Classes in a Standalone Application</TITLE> <META NAME="DESCRIPTION" CONTENT="APL language help page: Using System Classes in a Standalone Application"> <META NAME="KEYWORDS" CONTENT="standalone application,application,packager,runtime,executable, ⎕WI,apl,aplx,apl help"> <!-- %%COMMON_HEAD%% --> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <LINK rel="stylesheet" type="text/css" href="http://www.microapl.com/styles_apl_help.css"> <!-- %%END%%--> </HEAD> <body> <table> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm">APLX Help</A> : <A HREF="ch_110.htm">Standalone APL Applications</A> : <A HREF="ch_110_030.htm">The <code>⎕WI</code> Sub-System in a Standalone Application</A> </center> <center> [<A HREF="ch_110_020.htm">Previous</A> | <A HREF="ch_110_040.htm">Next</A> | <A HREF="ch.htm">Contents</A> | <A HREF="help_index.htm">Index</A> | <A HREF="http://www.microapl.co.uk/apl/index.html">APL Home</A> ]</center> <br></td> </tr> <tr> <td width="120"> <a href="http://www.microapl.co.uk/apl/index.html"><img height="68" border="0" width="119" src="MicroAPL_logo.gif" alt="www.microapl.co.uk"></a> </td> <td align="left" valign="bottom"> <h1>Using System Classes in a Standalone Application</h1> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <hr> <H2>User-defined windows and dialogs</H2> <p>APL applications which you write will typically use System Classes to create and manipulate windows, dialogs, and graphics. These will work in the standalone application in the same way as they do in the normal APL development environment, except that you should be careful not to rely on the APLX font being installed on the target system unless you specifically ensure that it is installed with your application.</p> <H2>MacOS About, Quit and Preferences menu items</H2> <p>Under Mac OS X, the 'About, 'Preferences' and 'Quit' menu items reside in the Application menu. (They are created automatically by the operating system). Because these menu items are not created under the control of your APL code, you cannot associate an APL callback function with them in the same way as you would for your own menus. APLX therefore provides three callbacks in the System object, which are triggered if any of these menu items are selected. They are <A HREF="ch_030_050_0005.htm"><tt>onAboutMenu</tt></A>, <A HREF="ch_030_050_0335.htm"><tt>onPreferencesMenu</tt></A>, and <A HREF="ch_030_050_0337.htm"><tt>onQuitMenu</tt></A>. You should use these callbacks to provide the appropriate functionality in your application, so that your program will respond correctly if the user selects one of these menu items.</p> <p>Under Windows or Linux, these callbacks can be defined, but will never be invoked.</p> <H2>Determining start-up parameters and responding to Apple Events</H2> <p>If you have packaged your APL workspace as a standalone application, it may be launched by the user dragging one or more documents on to the application icon or double-clicking a document (for this to work, you need to have set up the association between the file type/extension and the application). Under Windows or Linux, the user may also have started the application from the command-line. In either case, the System object's <tt><A HREF="ch_030_030_0005.htm">file</A></tt> property allows your APL program to respond correctly to these user actions. It is a read-only property, which you should retrieve at the beginning of your APL application code.</P> <p>Under MacOS, <tt>file</tt> contains the full names of the document or documents which you should open or print. If there are several file names, they will be delimited by carriage-return characters. The <tt><A HREF="ch_030_030_0005.htm">action</A></tt> property indicates whether your should open or print them. As well as checking these properties when your application starts, you should also respond to any <tt>onOpen</tt> event for the System object. This will be triggered if, once the application is running, the user drags further file icons of the right type on to the application icon (or double-clicks on a file icon). This event corresponds to the 'Open Document' and 'Print Document' Apple Events; the <tt>file</tt> and <tt>action</tt> properties will be updated to indicate the new files which need to be opened or printed..</p> <p>Under Windows, there are two possibilities. If the user dragged a document icon on to your application icon (or double-clicked the document icon), <tt>file</tt> will contain the full filename of the document. If the user started your application from the command-line, <tt>file</tt> will contain the command-line options which were entered.</p> <hr> </td> </tr> <tr> <td width="800" valign="top" colspan="2"> <center>Topic: <A HREF="ch.htm">APLX Help</A> : <A HREF="ch_110.htm">Standalone APL Applications</A> : <A HREF="ch_110_030.htm">The <code>⎕WI</code> Sub-System in a Standalone Application</A> </center> <center> [<A HREF="ch_110_020.htm">Previous</A> | <A HREF="ch_110_040.htm">Next</A> | <A HREF="ch.htm">Contents</A> | <A HREF="help_index.htm">Index</A> | <A HREF="http://www.microapl.co.uk/apl/index.html">APL Home</A> ]</center> <br></td> </tr> </table> <!-- %%COMMON_BODY_TAIL%% --> <p class="copyright">Copyright © 1996-2010 MicroAPL Ltd</p> <!-- %%END%% --> </body> </html>