save-as-text-file

Generic Function

Package: common-graphics

Arguments: window

This function is used by the File | Save As menu-item of the default menu-bar that may be interactively attached to a form. In the IDE, it demonstrates a typical "Save As" command for saving a text file but this function is not available in a runtime image. A custom application that implements a "Save As" command will need to supply its own code for such a command instead, but it may be useful to model after the default menu-bar's example. Here is the code for the save-as-text-file example:

(in-package :cg)
(defmethod save-as-text-file ((window basic-pane))
   (save-text-file-2 window))
(defun save-text-file-2 (window &optional pathname)
  (let* ((selected-window (selected-window window))
	 (pane nil))
    (cond ((typep selected-window 'text-edit-window)
	   (setq pane (frame-child selected-window))
	   (save-file pane pathname))
	  (t
	   #-runtime-system
	   (lisp-warning 
           "There is no selected text editor window to save."
           ))))) 

Common Graphics and IDE documentation is described in About Common Graphics and IDE documentation in cgide.htm.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.