Programming Guide



sm_filetypes

Adds an option to the file type option menu

int sm_filetypes(char *option_text, char *filters);

option_text
The text of the option to display on the file type option menu.

filters
A semicolon-separated list of file masks that specify the files selected through description.

Environment

Windows

Returns

Description

sm_filetypes defines a file type and adds it to the option menu that Panther displays in a file selection dialog box. This menu gives users an easy way to specify which files to show in the current directory.

You build the option menu through repeated calls to sm_filetypes. For example, the following statements define two files types, Text and Executables:

sm_filetypes("Text", "*.doc; *.txt");
sm_filetypes("Executables", "*.com; *.exe; *.bat");

The dialog box subsequently invoked by sm_filebox or sm_jfilebox contains an option menu with these file types. Options are displayed in order of their definition:

To change the menu, first reinitialize the current one by calling sm_filetypes with NULL arguments or empty strings, as in this JPL statement:

call sm_filetypes("", "")

See Also

sm_filebox