Opens a window at a given positionint sm_d_window(char *address, int start_line, int start_column);int sm_d_at_cur(char *address);int sm_l_window(int lib_desc, char *name, int start_line, int start_column);int sm_l_at_cur(int lib_desc, char *name);int sm_r_window(char *name, int start_line, int start_column);int sm_r_at_cur(char *name);
- The address of the screen in memory
- Specifies the library in which the window is stored, where
lib_descis an integer library descriptor returned by
sm_l_open. You must call
sm_l_openbefore you read any screens from a library.
- The name of the window.
- Specifies the window's top left corner, where
start_columnare zero-based offsets from the physical display's top left corner. Thus, setting
start_lineto 1 starts the window at the screen's second line. If the window does not fit on the display at the specified location, Panther adjusts it as needed.
A negative value for
start_linespecifies to clear the current screen before displaying the window. The screen's contents are discarded and cannot be restored.
sm_r_windowto display a screen as a stacked window at the specified line and column. Use
sm_r_at_curto display the window at the default position for that platform:
- On GUI platforms such as Windows, the window is positioned relative to the GUI display. For example, in Windows 95, the screen is positioned in the middle of the display; on Motif, it is positioned relative to the base window's status line.
The area of the display that surrounds the window remains visible. However, only the opened window is active, and only its fields are accessible to input and library functions. To change the active window, use
To display a form use
sm_r_formor one of its variants. Use
sm_close_windowto close the window.
When you use
sm_r_window, Panther looks for the named screen in the following places in this order:
- The application's memory-resident list; if found,
sm_d_windowis called to display the screen.
- All open libraries; if found,
sm_l_windowis called to display the screen.
If the search fails and the supplied file name has no extension, Panther appends the
SMFEXTENSION-specified extension to the file name and repeats the search. If all searches fail,
sm_r_windowdisplays an error message and returns.
You can save processing time by using
sm_d_at_curto display screens that are memory-resident. Use
bin2cto convert screens from disk files to program data structures that you can compile into your application.
A memory-resident screen never changes at runtime and therefore can be made sharable on systems let you share read-only data.
sm_r_at_curcan also display memory-resident screens if they are properly installed with
sm_formlist. Memory-resident screens are especially useful in applications with a limited number of screens, or in environments with a slow disk.
You can also save processing time with
sm_l_at_curto display screens from a library. A library is a single file that stores screens, JPL modules, and menus. You can assemble a library from individual screen files with
formlib. Libraries let you distribute a large number of screens with an application, and can improve efficiency by reducing the number of search paths.
/* Bring up a window from a library. */
if ((ld = sm_l_open ("myforms")) < 0)
sm_l_window (ld, "popup", 5, 22);