Lisp HUG Maillist Archive

Building a CAPI pane from parts

Hi,

If I write a function to return a pane to be used as part of a larger window in CAPI - for example:

(defun stat-pane (data) ()
  (make-instance 'grid-layout :columns 2 :has-title-column-p t :visible-border t :internal-border 2 :description
    (loop for (sym name) in *stat-names* appending
       (list (make-instance 'title-pane :text name)
             (make-instance 'display-pane)))))

What's the best way to provide references to the parts of the subpane to the caller? I don't really want to pack them into slots in the overall interface because that would mean the interface's slot list would have to be updated with all the parts of every subpane when they changed. Would an alist work, perhaps?

Mark

    

Re: Building a CAPI pane from parts

Hi Mark,

What about creating a subclass for your component and act on instances of that class. You could register callbacks functions to be notified about specific events.

Don’t forget that events in the CAPI happen in a specific process, therefore you need to take care of that aspect using (for example) mailboxes, if you don’t want to corrupt your state.

Best,
Cam


On 03 May 2015, at 00:52, Mark Green <mark@antelope.nildram.co.uk> wrote:

> Hi,
> 
> If I write a function to return a pane to be used as part of a larger window in CAPI - for example:
> 
> (defun stat-pane (data) () 
>   (make-instance 'grid-layout :columns 2 :has-title-column-p t :visible-border t :internal-border 2 :description
>     (loop for (sym name) in *stat-names* appending 
>        (list (make-instance 'title-pane :text name) 
>              (make-instance 'display-pane)))))
> 
> What's the best way to provide references to the parts of the subpane to the caller? I don't really want to pack them into slots in the overall interface because that would mean the interface's slot list would have to be updated with all the parts of every subpane when they changed. Would an alist work, perhaps?
> 
> Mark
> 
>      
> 


_______________________________________________
Lisp Hug - the mailing list for LispWorks users
lisp-hug@lispworks.com
http://www.lispworks.com/support/lisp-hug.html


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