CLIM mail archive


Re: clim:run-frame-top-level

>   Date: Wed, 7 Oct 92 11:12:51 CST
>   From: Randy Coulman <>
>   I have an application which requires that certain data be loaded from files 
>   before the user does anything else.  What I would like to do is pop up an
>   accepting values window before the top-level read-eval-print loop starts, but
>   after everything is displayed on screen.  I figured that the best way to do
>   this is to write my own top-level which does the prompting and then calls
>   clim:default-frame-top-level to start the REP loop.  However, it appears that
>   nothing is displayed in time for my accepting-values (:own-window t) to work
>   properly.  Does that mean that clim:default-frame-top-level actually displays
>   all of the panes and stuff like that?  Does that make sense?  Is there a way to
>   insert some initialization code between the displaying of panes and the running
>   of the REP loop?
>   If there is a better way to do what I need to do, can someone please let me
>   know?
>Yes, default-frame-top-level does the pane redisplay (each time around
>the loop, in fact).  You can display the panes yourself at the
>beginning of your top-level by:
>      (redisplay-frame-panes frame :force-p t)

This helps.  All my panes get displayed (except for scroll-bars), but I get
the following error when I try to do the accepting values (comments below are
my annotations):

Error: No methods applicable for generic function
       (#<EXCL::BIDIRECTIONAL-TERMINAL-STREAM @ #x6695e6>) of classes
  [condition type: PROGRAM-ERROR]

;;; I assume this means that something is not quite set up yet.

Restart actions (select using :continue):
 0: Try calling it again
 1: AROMA Knowledge Engineering System top level
 2: Exit AROMA Knowledge Engineering System
[Current process: main]
[1c] USER(1): :zoom
Evaluation stack:

           "No methods applicable for generic function ~s with args ~s of classes ~s"
   (NO-APPLICABLE-METHOD . #<non-lisp object @ #x-800262f>)
                          #<Function # @ #xc7012e> :OWN-WINDOW T)
   (KE:GET-DATA-PATH)  ;;; This is what calls accepting-values - def. is below
      #<KE:AROMA-KE @ #xcb05f6>)

... more older frames ...
[Current process: main]

Is there something else I need to call before I try to do the

Here's the "offending" function:

(defun get-data-path ()
  "Prompt the user for the path where data is stored."
  (let ((stream *standard-output*))
       (stream :own-window t)
       (clim:with-end-of-line-action (:allow stream)
	 (fresh-line stream)
	 (setq dbase:*datapath*
           ;; Most of the garbage below is to ensure that there is a "/" at
           ;; the end of the path; we want to make sure that we're
           ;; "probe-file"ing a directory and not a plain file.
	     (format nil "~A/"
		      (clim:accept 'clim:pathname
				   :stream stream
				   :default (pathname
				   :provide-default t
				   :insert-default t
				   :prompt "Data directory"
				   :display-default nil)) ))
	    *default-pathname-defaults*)) ))
      (if (probe-file dbase:*datapath*)
	(display-message "~&Directory not found.  Please specify a new ~
          directory or create the directory and try again.") ))

>You could also specialize read-frame-command, detecting the first

This seems like a bit of a hack, but may be necessary.

Randy A. Coulman                |       ARIES Laboratory
                                |       Department of Computational Science             |       University of Saskatchewan
                                |       Saskatoon, SK   S7N 0W0             


Follow-Ups: References:

Main Index | Thread Index