Lisp HUG Maillist Archive

RE: How to store CAPI window geometries?

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.
>

Re: How to store CAPI window geometries?

Sorry for the late reply.

On Tue, 7 Oct 2003 11:25:49 +0200 , Andreas Hinze <AHZ@smi.de> wrote:

> 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:
>
> [snip]

That one also works for me. Maybe I wasn't clear enough: It also works
with my app while I'm in the IDE. However, it doesn't work if I close
a delivered executable and then start it again. I thought this was
what the new framework is for. Or am I missing something? Maybe
someone from Xanalys wants to comment on this?

Thanks,
Edi.


Re: How to store CAPI window geometries?

Unable to parse email body. Email id is 1379

Updated at: 2020-12-10 08:59 UTC