CLIM mail archive

[Prev][Next][Index][Thread]

Re: clim:run-frame-top-level



>
>   Date: Wed, 7 Oct 92 11:12:51 CST
>   From: Randy Coulman <coulman%skdad.usask.ca@lucid.com>
>
>   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
       #<STANDARD-GENERIC-FUNCTION CLIM:WINDOW-PARENT @ #x84cabe> with args
       (#<EXCL::BIDIRECTIONAL-TERMINAL-STREAM @ #x6695e6>) of classes
       (EXCL::BIDIRECTIONAL-TERMINAL-STREAM)
  [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:

   (CERROR "Try calling it again" PROGRAM-ERROR :FORMAT-CONTROL
           "No methods applicable for generic function ~s with args ~s of classes ~s"
           ...)
 ->((METHOD NO-APPLICABLE-METHOD (T))
      #<STANDARD-GENERIC-FUNCTION CLIM:WINDOW-PARENT @ #x84cabe>
      #<EXCL::BIDIRECTIONAL-TERMINAL-STREAM @ #x6695e6>)
   (NO-APPLICABLE-METHOD . #<non-lisp object @ #x-800262f>)
   (CLIM:WINDOW-ROOT #<EXCL::BIDIRECTIONAL-TERMINAL-STREAM @ #x6695e6>)
   (CLIM::ACCEPT-VALUES-1 #<EXCL::BIDIRECTIONAL-TERMINAL-STREAM @ #x6695e6>
                          #<Function # @ #xc7012e> :OWN-WINDOW T)
   (KE:GET-DATA-PATH)  ;;; This is what calls accepting-values - def. is below
   ((METHOD KE::AROMA-KE-TOP-LEVEL (KE:AROMA-KE)) #<KE:AROMA-KE @ #xcb05f6>)
   (KE::AROMA-KE-TOP-LEVEL)
   ((METHOD CLIM:RUN-FRAME-TOP-LEVEL (CLIM:APPLICATION-FRAME))
      #<KE:AROMA-KE @ #xcb05f6>)

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

Is there something else I need to call before I try to do the
accepting-values?

Here's the "offending" function:

(defun get-data-path ()
  "Prompt the user for the path where data is stored."
  (let ((stream *standard-output*))
    (loop
      (clim:accepting-values
       (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.
	   (merge-pathnames
	    (parse-namestring
	     (format nil "~A/"
		     (namestring
		      (clim:accept 'clim:pathname
				   :stream stream
				   :default (pathname
					     (enough-namestring 
					      dbase:*datapath*))
				   :provide-default t
				   :insert-default t
				   :prompt "Data directory"
				   :display-default nil)) ))
	    *default-pathname-defaults*)) ))
      (if (probe-file dbase:*datapath*)
	  (return)
	(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
>call.
>

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

Randy
-- 
Randy A. Coulman                |       ARIES Laboratory
                                |       Department of Computational Science
coulman@cs.Usask.ca             |       University of Saskatchewan
                                |       Saskatoon, SK   S7N 0W0             


0,,

Follow-Ups: References:

Main Index | Thread Index