From: bellg@zeus.swindon.rtsg.mot.com (Graham Bell)
Subject: Re: Question: starting ileaf5 with clock window
Organization: Motorola LTD
Date: Wed, 7 Oct 1992 10:35:39 GMT

	There is another problem when you start the clock.lsp, if you resize the 
ileaf window the clock window resizes itself to approx 3 times its original 
size. (this is on a HP700). I asked about this a couple of months ago and
got this reply from Interleaf. (over the net!)


** Begin included massage **

Date: Thu, 20 Aug 92 17:42:35 EDT
From: lois@oldnorth.HQ.Ileaf.COM (Lois Lew)
Message-Id: <9208202142.AA01465@oldnorth.HQ.Ileaf.COM>
To: bellg@zeus.swindon.rtsg.mot.com
Subject: clock.lsp
Status: RO

The problem you describe is a bug (although I am unable to find the
bug number right now).  I developed the following workaround for
another user.  This code fixes the Resize option on Clock and adds an
option called "Orig size". If you choose Orig size it will put it back
to the original size.  You should put this in place of the clock.lsp in
the No Selection cabinet.

Hope this is what you need.

;; clock.lsp

 Copyright 1990 Interleaf, Inc., all rights reserved.
(lisp-set-implementation "Interleaf Lisp" "2.0")

(defpackage "clock"
  (:use "lisp" "ileaf" "stayup"))

(in-package "clock")

(require "edwin")
(require "stayup")

#.(msg-package "custom")

(defun do-popup (window)
  (edwin-prepare nil)
  (popup-run (if (edwin-get-selection window nil nil)
		 sel-pl
	       nosel-pl)
	     :context (cons window nil)))

(defvar sel-pl
  (popup-new-list
   (list (popup-new-entry #.(msgp "Copy") :handler 'edwin-copy-ph)
	 :default
	 (popup-new-entry #.(msgp "Deselect") :handler 'edwin-deselect-ph))))

(defvar nosel-pl
  (popup-new-list
   (list
    :default
    (popup-new-entry #.(msgp "Close") :handler 'close-ph)
    (popup-new-entry #.(msgp "Move") :handler 'move-ph)
    (popup-new-entry #.(msgp "Resize") :handler 'resize-ph)
    (popup-new-entry #.(msgp "Orig size") :handler 'osize-ph)
    (popup-new-entry #.(msgp "Front") :handler 'front-ph)
    (popup-new-entry #.(msgp "Back") :handler 'back-ph))))

(defun close-ph (datalist &optional context)
  (tell (car context) mid:close))

(defun move-ph (datalist &optional context)
  (let ((wn (tell (car context) mid:get-window)))
    (wn-move wn)))

(defun resize-ph (datalist &optional context)
  (let ((wn (tell (car context) mid:get-window)))
    (wn-resize  wn '(:right :bottom))))

(defun osize-ph (datalist &optional context)
  (let ((wn (tell (car context) mid:get-window)))
    (tell wn mid:set-props :size '(100 . 40))))

(defun front-ph (datalist &optional context)
  (let ((wn (tell (car context) mid:get-window)))
    (wn-front wn)))

(defun back-ph (datalist &optional context)
  (let ((wn (tell (car context) mid:get-window)))
    (wn-back wn)))

(defun clock-tick ()
  "Called on clock-timer event. Updates *clock-win* with current time."
  (cond
   ((obj-validp *clock-win*)
    (stayup:clear *clock-win*)
    (stayup:add-string (strftime "%0H:%0M") *clock-win*))
   (t
    (tell clock-timer mid:stop))))

;;;
;;;	Initialization:
;;;

;;take down any old clock

(defvar clock-class (obj-new-class stayup-class "clock"))
(obj-provide clock-class mid:popup 'do-popup)

(and (boundp '*clock-win*)
     (obj-validp *clock-win*)
     (tell *clock-win* mid:free))
(setq *clock-win* (stayup nil :title nil :size '(100 . 40) :font "serifa36"))
(tell *clock-win* mid:set-class clock-class)
(tell *clock-win* mid:set-props
      :window-type :mn
      :scrollbars nil
      :messagebar nil)

(if (boundp 'clock-timer)
    (tell clock-timer mid:stop)
  (setq clock-timer (tell-class wn-timer-class mid:new))
  (tell clock-timer mid:put-data :expression '(clock-tick)))

(tell clock-timer mid:set-props  :repeat t  :delta-time 30000)
(tell clock-timer mid:start)

(clock-tick)

** end included message **

I hope this helps


-- 
Graham Bell,		Tel No	+44 793 545248
Motorola Ltd,		Fax No	+44 793 541228
16 Euro Way,		E-mail	bellg@zeus.swindon.rtsg.mot.com
Blagrove, Swindon, 		uunet!motcid!zeus!bellg
England, SN5 8YW.
Newsgroups: comp.text.interleaf