[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Making a simple window, and dumplisp in allegro (was Re: Problem in running express-windows !! )
You can't make a window until you call (initialize-window-system).
Have you tried running the demos, by doing
:pa ew
(run-program 'lisp-listener) ; see frames.lisp
The mouse window should show you what the buttons do.
Click right to get a menu, or type S<space>M<space>, which is an abbreviation
for System Menu.
You don't need to load the common windows at all, just CLX. I don't think
this should cause any problems; at its most harmless will probably only make
method dispatch just a little bit slower.
---------------------------------
Here's what I just tried:
<cl> (initialize-window-system)
NIL
<cl> *root-window*
#<PRESENTATION-WINDOW 70014576> ;this is default superior if I don't specify
<cl> (setq w2 (make-window 'WINDOW :BORDERS 1
:LEFT 10 :TOP 10
:HEIGHT 250 :WIDTH 400))
#<PRESENTATION-WINDOW 72343356>
<cl> (expose-window w2)
;;; now we see it
NIL
<cl> (let ((*query-io* w2))
(querying-values (*query-io* :label "Just a test.")
(query '((alist-member :alist (one two three)))
:prompt "Choose one" :default 'two)))
THREE
<cl> (print "Hello." w2)
"Hello."
<cl> (force-output w2) ; forces out any waiting output.
NIL
<cl>
Normally, your application will be using Express-Windows for input, and the
output will automatically be flushed, so (force-output ..) is rarely necessary.
You can also use (sync) for this, which will take care of any waiting output
(for the X display).
Again, you should look at the demos for example i/o coding and use of
define-program-framework.
---------------------------------
BUILDING A CORE:
Here's how I did it. If the following is make-ew-core.lisp, then (in allegro)
cl -qq < make-ew-core.lisp > make-ew-core.output
You'll have to load pcl & clx yourself (my core already had these).
Note that I call (load-ew) directly, otherwise I would be prompted for
(compile, load) x (pcl, clx, ew).
Also, I put the optional files onto the ew-files, and set optional files to
(), so I don't get prompted for those either. You might want to replace the
call to (load-ew) with similar loading code, depending on your needs.
------------
;;; Dump a core with express windows loaded.
(in-package :user)
#+excl
(unless (excl::scheduler-running-p)
(mp:start-scheduler))
(load (make-pathname :name "system" :type "lisp" :defaults *Default-EW-Code-Pathname*))
;; Don't ask about optional files, just do 'em
(setf *Ew-Files-Copy* (append *Ew-Files-Copy* *Optional-Ew-Files-Copy*)
*Optional-Ew-Files-Copy* ())
(user::load-ew)
(setq ew::*Default-Host* "unix") ; will this give better results?
;;; Okay, now save the world...
(excl:chdir "/usr/toad/")
;; are these necesary? right order?
(excl:gc t)
(excl:gc :tenure)
(excl:dumplisp :name "express"
:read-init-file t
:restart-function nil
; :restart-actions nil
:checkpoint nil)
(print "Core dumped.")
(excl:exit 0 :no-unwind t)
---------------------------------
It was my first dumplisp for allegro, and though it works, I'm not satisfied
with the way (room) looks; there seems to be several empty oldspaces taking
up a couple meg, and the core file is 12M (on a sparc (RISC)); space in core
(by (room)) shows 6.5M used. I tried a couple gc tweaks, but it didn't seem
to change. Anyone have hints?
-todd