|
NAMEXmtAskForFile(), XmtAskForFilename() - use a file selection dialog box to prompt the user to select a file and return the user's response.SYNOPSISBoolean XmtAskForFile(Widget w,
String query_name, String prompt_default,
String directory_default, String pattern_default,
FILE **value_return, String file_mode,
String filename_buffer, int filename_buffer_len,
String directory_buffer, int directory_buffer_len,
String pattern_buffer, int pattern_buffer_len,
String help_text_default)
Boolean XmtAskForFilename(Widget w, String query_name, String prompt_default, String directory_default, String pattern_default, String filename_buffer, int filename_buffer_len, String directory_buffer, int directory_buffer_len, String pattern_buffer, int pattern_buffer_len, String help_text_default) ARGUMENTSINPUTS
True if the user clicked the Ok button or double-clicked on a filename to dismiss the dialog; False if the user clicked the Cancel button. DESCRIPTIONXmtAskForFile() and XmtAskForFilename() display an application modal Motif file selection dialog, of the type created by XmCreateFileSelectionDialog(). They process events in a local event loop until the user double-clicks on a filename or selects the Ok or Cancel buttons of the dialog, and then return control to the calling procedure. If the user clicks on the Cancel button, these functions return False immediately. Otherwise, they store the full name of the selected file into filename_buffer and return True.In addition to these actions, XmtAskForFile() opens the selected file as specified by file_mode, and stores the opened file at the address specified by value_return. If the attempt to open the specified file fails, XmtAskForFile() displays an error dialog (using XmtDisplayError()). On entry to XmtAskForFile() or XmtAskForFilename(), the contents of filename_buffer are used as the default filename to display to the user. In addition, if directory_buffer and pattern_buffer are non-NULL and are not empty, then they are used as the initial directory and the initial pattern for the file selection box. If these arguments are NULL, then the initial directory and pattern are looked up in the resource database, and if they are not found there, directory_default and pattern_default are used as the defaults. If directory_buffer and pattern_buffer are non-NULL, and directory_buffer_len and pattern_buffer_len are not 0, then when these functions return True, they store the current directory and pattern of the file selection box into these buffers. You can use these returned values with the next invocation of these functions-see Chapter 26, Simple Input Dialogs for discussion of this point. If help text is found in the resource database for this instance of the dialog, or if the help_text_default argument is non-NULL, then this text will be displayed (using XmtDisplayInformation()) when the user clicks on the Help but ton. If there is no help available for the dialog, then the Help button will be insensitive. Customization To allow customization, XmtAskForFile() and XmtAskForFilename() look up the following subpart resources of the toplevel shell. The name of the subpart is given by the query_name argument, and the class of the subpart is ``XmtFileDialog''. These subpart resources are looked up every time the functions are called, not simply when the widgets are created.
WIDGETS XmtAskForFile() and XmtAskForFilename() create an XmDialog Shell widget named ``xmtFileDialogShell'' and an XmFileSelectionBox widget named ``xmtFileDialog'' as a child of the XmDialogShell. Once this dialog has been created, it is cached for reuse by subsequent calls. SEE ALSOChapter 26, Simple Input Dialogs,XmtAskForBoolean(), XmtAskForDouble(), XmtAskForInteger(), XmtAskForItem(), XmtAskForItemNumber(), XmtAskForString().
Visit the GSP FreeBSD Man Page Interface. |