DTPAD(1X) — Commands
NAME
dtpad − the Common Desktop Environment text editor.
SYNOPSIS
dtpad [ −options ] [ file ]
DESCRIPTION
Dtpad is a basic editor which supports editing of text files in a manner consistent with other common Graphical User Interface text manipulation and file access mechanisms. Cursor positioning and text selection as well as access to various edit operations can be done via the mouse or user definable key combinations. Text can be cut, copied, pasted and drag-droped to/from the Text Editor or other compliant application windows via the standard Motif Clipboard and ICCCM Primary and Secondary selection mechanisms. The Text Editor also provides a number of features beyond the common text manipulation mechanisms. This includes search and replace, simple formatting and word wrap, spell checking and a single level undo operation as well as pull down menus for common edit and file operations. An optional status line can be displayed allowing cursor positioning by line number. Saving of text on external or infa-structure related errors is automatically performed and a mechanism for session save and restore is also provided. In addition, the Text Editor can be a drag target for files in the Common Desktop Environment, allowing a File Manager file icon to be dropped on a Text Editor window for insertion at the current cursor position. In the Common Desktop Environment, the Text Editor operates in a transparent client/server mode in which all text editing for a display is handled by a single Text Editor "server" process. In this the default mode, any invocation of the Text Editor will cause the invoked Text Editor process to be relegated to the role of a "requestor" process in which it will simply send an edit request to a server process which will handle the actual editing in a separate window, completely independant of the requestor process. If a Text Editor server for the display isn’t running when the requestor sends it edit request, CDE will be automatically start one, normally on the CDE session server (which need not be the same as the requestor’s host). The requestor will normally just "block" until told by the server to exit when its edit window is closed; however, there is no requirement that the requestor remain around after the server accepts its edit request. If the server can’t honor the edit request (e.g. it can’t access the requestor’s file), the requestor will handle the editing by itself. Note that the normal client/server behavior can be disabled or altered via the Client/Server Control options listed below. The last argument on the command line should be the name of file to be edited or viewed. If no file is specified, the Text Editor will open a "new" (empty) edit window and the file name must be specified when the contents are saved.
OPTIONS
BASIC COMMAND LINE OPTIONS
−statusLine
This option causes a status line to be displayed at the bottom of the edit window. The status line shows the line number of the line where the text cursor is currently positioned, and possibably some other information. Note that the text cursor can be positioned to a specific line by selecting the line number window in the status line, typing the desired number and pressing [Return]. Normally a status line is not displayed.
−wordWrap
This option initially turns on "window" word wrap. Window word wrap can be toggled on or off via the "Edit" menu "Word Wrap" button and normally is initially turned off. (See the "Notes" section for more information on word wrap.)
−saveOnClose
This option causes the current text to be saved automatically and silently when there are unsaved changes and the Text Editor is exited or a new file is edited. The default action for this situation is to post a dialog asking whether or not to save the current text.
−missingFileWarning
This option causes a warning dialog to be posted whenever a filename is specified and the file does not exist or can not be accessed.
−noReadOnlyWarning
This option disables the warning dialog posted whenever a file is read for which the user doesn’t have write permission. The default is to post a warning dialog whenever this situation occurs.
−noNameChange
This option indicates that the current file name should not change as the result of a "File" menu "Save As" operation. By default, the current file name is changed to the file specified in a "Save As" operation.
−viewOnly
This option disallows editing of text in the edit window, essentially turning the Text Editor into a text viewer. The default is to allow editing of text in the edit window even if the text was obtained from a file for which the user doesn’t have write permission.
−workspaceList workspace_list
This option causes the edit window for the current invocation of the Text Editor to be displayed in the specified workspace(s). The default is to display the edit window in the workspace in which the Text Editor was invoked.
workspace_list
Specifies a blank separated list of Common Desktop Environment workspaces. If more than one workspace is specified, the list must be enclosed in quotes.
−session session_file
This option causes the Text Editor is to restore all text editing windows and settings that were in effect at a previous Common Desktop Environment shutdown. All other command line options are ignored when this option is specified.
session_file
Specifies a Text Editor session file, previously save at session shutdown by the Text Editor, to be used to restore the Text Editor to its state at shutdown.
CLIENT/SERVER CONTROL OPTIONS
−standAlone
This option forces the current invocation of the Text Editor to do its own text processing in its own window, independently of the Text Editor server. This can be useful if one desires an instance of the Text Editor with an environment different from that of other edit windows controlled by the server as, for example, to specify a different locale or different color resources. The Text Editor is still able to support the drag and drop of files in this mode.
−noBlocking
This option causes the Text Editor "requestor" process to terminate as soon as the Text Editor server determines that it can handle the requestor’s edit request. If this option is not specified, the requestor will block, terminating only when it receives notification from the server that it’s edit window has been closed.
−server
This option forces a Text Editor "server" to be started up (if one is not already running) to handle the processing for all subsequent edit requests for the display. These edit requests are normally generated by subsequent invocations of the Text Editor without the -standAlone command line option and cause the server to create a separate edit window to handle each request. Users normally do not need to use this option since the initial edit request for the display will cause the Common Desktop Environment to start a Text Editor server automatically.
−exitOnLastClose
This option specifies that the Text Editor server process should terminate when the last edit window for the display is closed. It should only be used with the -server option since it only applies to the server process. If this option is not specified the Text Editor server will remain active indefinitely, even when all active edit windows have been closed.
APPLICATION SERVER SUPPORT OPTIONS (∗∗UNSUPPORTED∗∗)
−idString string
This option indicates a string by which a particular Text Editor window can be identified. Subsequent invocations of the Text Editor can use this sting to reference the identified window and force a change to its contents. Programs that invoke dtpad can use this option to provide a single dtpad"viewer" window.
string Specifies a unique string to be used to identify the window.
−directory directory
This option indicates a directory to seed the "Open" and "Include" dialogs. The default in to used the current directory
directory
Specifies the Open/Include dialog seed director.
−saveAsDir directory
This option indicates a directory to seed the "SaveAs" dialog. The default in to used the current directory
directory
Specifies the SaveAs dialog seed director.
−mainTitle string
This option indicates a string, combined with the current file name, to form the title of the Text Editor’s main window and supporting dialogs. The default is to use "TextEditor"
string Specifies the text used in the main window and supporting dialog titles.
−noNameInTitle
This option indicates that the name of the file being edited should not appear in the window title. This can be useful if the file is a temporary file with a meaningless name.
−exitLabel string
This option indicates a string to be used for the label of the "File" menu "Exit" button. This can be useful to indicate "Return to <application>" rather then "Exit" when the text editor is run indirectly via an application.
string Specifies the text used in the "File" menu "Exit" button.
−exitNmemonic character
This option indicates a "File" menu "Exit" button mnemonic. This is useful to set the mnemonic to a character in the "Exit" button label when the label is changed.
character
Specifies the nmemonic character used for the "File" menu "Exit" button.
−helpVol volume
This option indicates that a non-standard text editor help volume should be used.
volume
Specifies the text editor help volume.
−noMenubar
This option indicates that the menu bar containing the File, Edit, Search, Format and Help pulldown menus will not be included in the text editor window.
−confirmationString string
This option specifies the contents of the prompt string that appears in the dialog box displayed immediately before the Text Exitor is exited. This string must prompt the user for a yes/no response which determines the exit status of the Text Editor. A "Yes" response results in an exit status of 0, and a "No" response causes an exit status of 1. It is typically used by a program invoking the Text Editor as, such as a mail program which could ask the user via the Text Editor exit dialog if they wish to send the text as a message.
string Specifies the yes/no confirmation prompt.
−noExit
This option indicates that no "Exit" button will display in the "File" menu and that the Text Editor can not be exited. This option (in combination with -idString and other options) could be used by an invoking program, such as a mail user interface, to provide a single, permanent Text Edit window in which it could display all mail messages.
−closeImmediate
This option is normally used with the -idString option to immediately close a specific edit widow.
RETURN VALUES
0 Dtpad exited normally without errors.
1 Dtpad exited abnormally due to errors or receipt of a "panic" signal or internal X error (see the "Files" section for information on error conditions).
-1 Dtpad couldn’t open a connection to the display.
RESOURCES
dtpad supports the specific Text Editor resources described here plus the standard resources related to the widget hierarchy of the Text Editor. The main widgets that make up the Text Editor hierarchy are show below to aid in specification of resources. The widget instance name is shown first followed by the widget class name in parentheses. Indentation indicates hierarchical structure. dtpad (Dtpad)
main (MainWindow)
bar (MenuBar)
fileMenu (PulldownMenu)
editMenu (PulldownMenu)
searchMenu (PulldownMenu)
helpMenu (PulldownMenu)
??? (DtEditor)
??? (XmText)
??? (???) The client/server architecture of dtpad restricts the scope of resources that can be specified for individual edit windows handled by the Text Editor server. For efficiency, only the resources specific to the Text Editor. None of the standard widget resources, except for geometry, are passed on from the "requestor" Text Editor to the Text Editor server. These resources are loaded according to the environment on the server’s host at the time the server is started up. If more control is required, use the -standAlone command line option to create a separate, stand alone dtpad process where any and all of the standard resources, such as fontList or colors, can be loaded according to the environment on the requestor’s host.
| Dtpad Resources | |||
| Name | Class | Type | Default |
| statusLine | StatusLine | Boolean | False |
| wordWrap | WordWrap | Boolean | False |
| saveOnClose | SaveOnClose | Boolean | False |
| missingFileWarning | MissingFileWarning | Boolean | False |
| readOnlyWarning | ReadOnlyWarning | Boolean | True |
| nameChange | NameChange | Boolean | True |
| viewOnly | ViewOnly | Boolean | False |
| workspaceList | WorkspaceList | String | NULL |
| session | Session | String | NULL |
| standAlone | StandAlone | Boolean | False |
| blocking | Blocking | Boolean | True |
| server | Server | Boolean | False |
| exitOnLastClose | ExitOnLastClose | Boolean | False |
| idString | IdString | String | NULL |
| directory | Directory | String | NULL |
| saveAsDir | SaveAsDir | String | NULL |
| mainTitle | MainTitle | String | NULL |
| nameInTitle | NameInTitle | Boolean | True |
| exitLabel | ExitLabel | String | NULL |
| exitMnemonic | ExitMnemonic | String | NULL |
| helpVol | HelpVol | String | NULL |
| menuBar | MenuBar | Boolean | True |
| confirmationString | ConfirmationString | String | NULL |
| allowExit | AllowExit | Boolean | True |
| closeImmediate | CloseImmediate | Boolean | False |
BASIC RESOURCES
statusLine
Indicates whether the Text Editor should display the statusLine at the bottom of the edit window. Setting this resource to True will display the status line and is equivalent to specifying the -statusLine command line option.
wordWrap
Indicates whether the Text Editor should enable window word wrap when the editor is started. Setting this resource to True will enable window word wrap and is equivalent to specifying the -wordWrap command line option.
saveOnClose
Indicates whether the Text Editor should automatically save the current text when there are unsaved changes and the Text Editor is exited or a new file is edited. Setting this resource to True automatically save unsaved changes and is equivalent to specifying the -saveOnClose command line option.
missingFileWarning
Indicates whether a warning dialog should be posted when a file is specified that does not exist or can not be accessed. Setting this resource to True display the warning and is equivalent to specifying the -missingFileWarning command line option.
readOnlyWarning
Indicates whether a warning dialog should be posted when a file for which the user does not have write permission is read. Setting this resource to False will cause the warning to be suppressed and is equivalent to specifying the -noReadOnlyWarning command line option.
nameChange
Indicates whether the current file name should be reset to the name specified in a "Save As" dialog. Setting this resource to False will not allow the name to be reset and is equivalent to specifying the -noNameChange command line option.
viewOnly
Indicates whether text only be viewed or whether it can be edited in the edit window. Setting this resource to True will disable editing of text and is equivalent to specifying the -viewOnly command line option.
workspaceList
Indicates which workspace(s) the Text Editor should be displayed in. This is functionally equivalent to specifying the -workspaceList command line option.
session
Specifies the saved session file to use in restoring a previously saved Editor session. This is functionally equivalent to the -session command line argument.
CLIENT/SERVER CONTROL RESOURCES
standAlone
Specifies whether the Text Editor should run as a separate, independant Text Editor process without utilizing the Text Editor server. Setting this resource to True invokes a separate, independant process and is equivalent to specifying the -standAlone command line option.
blocking
Specifies whether the "client" Text Editor process should not terminate until receiving notification from the Text Editor server that the user exited or closed its edit window. Setting this resource False causes the client process to exit immediately when the server determines that it can handle its edit request and is equivalent to specifying the -noBlocking command line option.
server
Specifies that the Text Editor should be started in server mode to handle all processing for all subsequent edit requests for the display. Setting this resource to True is functionally equivalent to specifying the -server command line option.
exitOnLastClose
Specifies that the Text Editor "server" should terminate when the last edit window for the display is closed. Setting this resource to True is functionally equivalent to specifying the -exitOnLastClose command line option.
APPLICATION SERVER SUPPORT RESOURCES (∗∗UNSUPPORTED∗∗)
exitOnLastClose
Used when the server resource is True to indicate whether the Text Editor server process should terminate when the last active edit window is closed. If this resource is False, then the server will continue to run, ready to receive a message to edit a file. If this resource it True, the the Text Editor will terminate when the last active edit window is closed.
idString
Spceifies a string by which a particular edit window can be identified This is functionally equivalent to specifying the -idString command line option.
directory
Specifies a directory to seed the "File" menu "Open" and "Include" dialogs. This is functionally equivalent to specifying the -directory command line option.
saveAsDir
Specifies a directory to seed the "File" menu "Save As" dialog. This is functionally equivalent to specifying the -saveAsDir command line option.
mainTitle
Specifies the string to be used as the window title. If this resource is non-NULL, then the window’s title will not be updated when and if the user uses the "Open" menu item to edit a different file. This is functionally equivalent to the -mainTitle command line option.
nameInTitle
Indicates whether (True) or not (False) the name of the file being edited should appear in the window title. Setting this resource to False is equivalent to specifying the -noNameInTitle command line option.
exitLabel
Specifies a string to be used for the label of the "File" menu "Exit" button. This is functionally equivalent to specifying the -exitLabel command line option.
exitMnemonic
Specifies the "File" menu "Exit" button mnemonic. This is functionally equivalent to specifying the -exitNmemonic command line option.
helpVol
Specifies a non-standard Text Editor help volum. This is functionally equivalent to specifying the -helpVol command line option.
menuBar
Indicates whether or not a menubar should be displayed. Setting this resource to False is equivalent to specifying the -noMenubar command line option.
confirmationString
Specifies the string to be put in a dialog box to ask the user a yes/no question immediately before exiting the editor. This is typically used by an invoking program. As an example, a mailer could use this resource to ask the user if they wish to send the message. The user’s response determines the exit status of the Text Editor, with a "Yes" response resulting in an exit status of 0, and a no response resulting in an exit status of 1. This is functionally equivalent to the -confirmationString command line option.
allowExit
Indicates whether or not an "Exit" button will appear in the "File" menu. Setting this resource to False is equivalent to specifying the -noExit command line option.
closeImmediate
Normally used with /fBidString/fP to immediately close a specific edit window. This is functionally equivalent to specifying the -closeImmediate command line option.
ENVIRONMENT
<Introductory paragraph.>
ENVIRONMENTVARIABLE
<Description>
FILES
.../dt/app-defaults/Dtpad
application defaults file containing the default resources for the Text Editor.
#[#]filename "panic save" file containing the current text. This file is automatically output to the current directory by Dtpad when the current text has not been saved and a "panic" signal or internal X error is encountered. (See the "Notes" section for more details.)
SEE ALSO
NOTES
One Text Editor Server Per Display
Only one Text Editor can be started with the -server option for a single display.
Word Wrap Mode And Formatting
Word wrap and text formatting are essentially disjoint features. Word wrap is the Motif text widget word wrap which pretains to the display of lines (as delimited by a line feed character) that go beyond the right window boundary. When word wrap is turned off (the default mode), these lines appear on a single display line, with text outside the window boundaries accessed via the horizontal scroll bar. When word wrap is turned on, all text that normally would be hidden by the right window boundary will be wrapped at a word boundary to one or more additional display lines. Formatting, on the other hand, inserts permanent line feed characters (and leading/embedded space) in either the current paragraph, as delimited by a blank line, or in the entire file according the "Format" menu "Settings" dialog values. Note that word wrap is not affected by format margins but that formatting is affected by window boundaries in that the format margins are automatically set to the window boundaries when the window is initially displayed and each time it is resized. Note also that when text is saved while word wrap mode is turned on, the Text Editor will ask whether or not to add explicit new line characters to the output to make it correspond to the display lines.
Panic Save File
Dtpad automatically saves the current text to a "panic save" file before exiting whenever it encounters a "panic" signal or an internal X error. Panic signals are signals such as SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGABRT, SIGIOT, SIGEMT, SIGFPE, SIGBUS, SIGSEGV, SIGSYS, SIGPIPE and SIGTERM. Internal X errors are both non fatal X Error events (as trapped by XSetErrorHandler), such as a failure in X server memory allocation, and fatal X errors (as trapped by XSetIOErrorHandler), such as losing the connection to the X server. Dtpad constructs the name of the panic save file by prepending a "#" character to the name of the file being edited (or "##" if a file by the first name already exists). If the current text is not associated with a file, "#noName" (or "##noName") is used. If both the "#" and "##" derivatives already exist, even if writable, no panic save file will be generated.
— 11 May 1994