RE: How to store CAPI window geometries?
Hi Edi,
your code looks right to me. Here is an example that works
(means the window size is remembered and written in the registry)
on Windows XP with LWW 4.3.6:
;------------------------------------------------
(use-package "CAPI")
(setf (sys:product-registry-path :foo-bar)
'("Software" "AHz" "The foo-bar test"))
(define-interface demo ()
()
(:panes
(editor editor-pane :text "Hi Edi"))
(:layouts
(main row-layout '(editor)))
(:default-initargs :title "Demo"))
(defmethod top-level-interface-save-geometry-p ((interface demo))
t)
(defmethod top-level-interface-geometry-key ((interface demo))
(values 'demo :foo-bar))
;type "(contain (make-instance 'demo)" to run
;------------------------------------------------
Hope that helps
Regards
AHz
>-----Original Message-----
>From: Edi Weitz [mailto:edi@agharta.de]
>Sent: Saturday, October 04, 2003 1:47 AM
>To: lisp-hug@xanalys.com
>Subject: How to store CAPI window geometries?
>
>
>Hi!
>
>I'm trying to use the new feature of 4.3 which enables me to store
>user preferences. It works fine for me if I store arbitrary values
>into the registry, however I don't seem to succeed in storing CAPI
>window geometries. Here's what I do (LWW pro 4.3.6):
>
>
>1. I have an interface REGEX-INTERFACE defined with
> DEFINE-INTERFACE. (My package USEs the CAPI package.)
>
>2. I've defined the following methods for this interface:
>
> (defmethod top-level-interface-save-geometry-p
> ((interface regex-interface))
> t)
>
> (defmethod top-level-interface-geometry-key
> ((interface regex-interface))
> (values 'regex-interface
> :regex-coach))
>
>3. My application starts with
>
> (setf (sys:product-registry-path :regex-coach)
> '("Software" "Edi Weitz" "The Regex Coach"))
>
> before it creates the interface like this:
>
> (setq *interface* (make-instance 'regex-interface))
>
>
>Now, as I said, I can use the USER-PREFERENCE function to store and
>load values and everything works fine - I also see these values with
>regedit. However, no geometry data is written to the registry when I
>exit the program - it always starts up with the default values.
>
>What am I missing?
>
>Thanks,
>Edi.
>