Lisp HUG Maillist Archive

Breakpoints not firing in CAPI callbacks?

Lispworks 5.0.1 on OS X.  Here is a trivial CAPI interface:

----
(defpackage :foo (:use :cl :capi))
(in-package :foo)

(define-interface foo ()
  ()
  (:panes
   (foo
    text-input-pane
    :callback-type :interface-item
    :callback (lambda (interface item)
                (display-message "~A ~A" interface item))))
  (:layouts
   (main column-layout '(foo))))

(capi:display (make-instance 'foo))
-----

If I toggle a breakpoint at the beginning of the display-message form,
I never get dropped into the stepper when I trigger the callback.  The
DISPLAY-MESSAGE call does get evaluated, so I'm trying to figure out
why the breakpoint seems to be ignored.  In code that doesn't involve
CAPI, breakpoints fire without issue.

-- 
Bill Atkins


RE: Breakpoints not firing in CAPI callbacks?

> From: owner-lisp-hug@lispworks.com 
> [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Bill Atkins
> Sent: 22 December 2006 06:31
> To: Lisp HUG
> Subject: Breakpoints not firing in CAPI callbacks?
> 
> 
> Lispworks 5.0.1 on OS X.  Here is a trivial CAPI interface:
> 
> ----
> (defpackage :foo (:use :cl :capi))
> (in-package :foo)
> 
> (define-interface foo ()
>   ()
>   (:panes
>    (foo
>     text-input-pane
>     :callback-type :interface-item
>     :callback (lambda (interface item)
>                 (display-message "~A ~A" interface item))))
>   (:layouts
>    (main column-layout '(foo))))
> 
> (capi:display (make-instance 'foo))
> -----
> 
> If I toggle a breakpoint at the beginning of the display-message
form,
> I never get dropped into the stepper when I trigger the callback.
The
> DISPLAY-MESSAGE call does get evaluated, so I'm trying to figure out
> why the breakpoint seems to be ignored.  In code that doesn't
involve
> CAPI, breakpoints fire without issue.
> 
> -- 
> Bill Atkins

I get the same behaviour if I compile the code and enter
something in the resulting TEXT-INPUT-PANE.  But if I evaluate
the CAPI:DISPLAY form after compiling the rest of the code, all
is ok.
(LW 5.0.0 on Windows.)

Simon



RE: Breakpoints not firing in CAPI callbacks?

> From: owner-lisp-hug@lispworks.com 
> [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Simon Katz
> Sent: 22 December 2006 11:38
> To: 'Lisp HUG'
> Subject: RE: Breakpoints not firing in CAPI callbacks?
> 
> 
> > From: owner-lisp-hug@lispworks.com 
> > [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Bill Atkins
> > Sent: 22 December 2006 06:31
> > To: Lisp HUG
> > Subject: Breakpoints not firing in CAPI callbacks?
> > 
> > 
> > Lispworks 5.0.1 on OS X.  Here is a trivial CAPI interface:
> > 
> > ----
> > (defpackage :foo (:use :cl :capi))
> > (in-package :foo)
> > 
> > (define-interface foo ()
> >   ()
> >   (:panes
> >    (foo
> >     text-input-pane
> >     :callback-type :interface-item
> >     :callback (lambda (interface item)
> >                 (display-message "~A ~A" interface item))))
> >   (:layouts
> >    (main column-layout '(foo))))
> > 
> > (capi:display (make-instance 'foo))
> > -----
> > 
> > If I toggle a breakpoint at the beginning of the display-message
> form,
> > I never get dropped into the stepper when I trigger the callback.
> The
> > DISPLAY-MESSAGE call does get evaluated, so I'm trying to figure
out
> > why the breakpoint seems to be ignored.  In code that doesn't
> involve
> > CAPI, breakpoints fire without issue.
> > 
> > -- 
> > Bill Atkins
> 
> I get the same behaviour if I compile the code and enter
> something in the resulting TEXT-INPUT-PANE.  But if I evaluate
> the CAPI:DISPLAY form after compiling the rest of the code, all
> is ok.
> (LW 5.0.0 on Windows.)
> 
> Simon

Further to that, I only have the problem if I display the interface
and then set the breakpoint.  If I set the breakpoint and then
display the interface all is ok.  But after I've seen one stepper
window, subsequently there is no problem -- I can toggle the
breakpoint and display new interfaces in any order and the
stepper window appears as expected.

Simon



Re: Breakpoints not firing in CAPI callbacks?

On 12/22/06, Simon Katz <sk@nomistech.com> wrote:
>
> > From: owner-lisp-hug@lispworks.com
> > [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Simon Katz
> > Sent: 22 December 2006 11:38
> > To: 'Lisp HUG'
> > Subject: RE: Breakpoints not firing in CAPI callbacks?
> >
> >
> > > From: owner-lisp-hug@lispworks.com
> > > [mailto:owner-lisp-hug@lispworks.com] On Behalf Of Bill Atkins
> > > Sent: 22 December 2006 06:31
> > > To: Lisp HUG
> > > Subject: Breakpoints not firing in CAPI callbacks?
> > >
> > >
> > > Lispworks 5.0.1 on OS X.  Here is a trivial CAPI interface:
> > >
> > > ----
> > > (defpackage :foo (:use :cl :capi))
> > > (in-package :foo)
> > >
> > > (define-interface foo ()
> > >   ()
> > >   (:panes
> > >    (foo
> > >     text-input-pane
> > >     :callback-type :interface-item
> > >     :callback (lambda (interface item)
> > >                 (display-message "~A ~A" interface item))))
> > >   (:layouts
> > >    (main column-layout '(foo))))
> > >
> > > (capi:display (make-instance 'foo))
> > > -----
> > >
> > > If I toggle a breakpoint at the beginning of the display-message
> > form,
> > > I never get dropped into the stepper when I trigger the callback.
> > The
> > > DISPLAY-MESSAGE call does get evaluated, so I'm trying to figure
> out
> > > why the breakpoint seems to be ignored.  In code that doesn't
> > involve
> > > CAPI, breakpoints fire without issue.
> > >
> > > --
> > > Bill Atkins
> >
> > I get the same behaviour if I compile the code and enter
> > something in the resulting TEXT-INPUT-PANE.  But if I evaluate
> > the CAPI:DISPLAY form after compiling the rest of the code, all
> > is ok.
> > (LW 5.0.0 on Windows.)
> >
> > Simon
>
> Further to that, I only have the problem if I display the interface
> and then set the breakpoint.  If I set the breakpoint and then
> display the interface all is ok.  But after I've seen one stepper
> window, subsequently there is no problem -- I can toggle the
> breakpoint and display new interfaces in any order and the
> stepper window appears as expected.
>
> Simon

I don't get the Stepper in any of those cases.  Incidentally, creating
a new function, setting a breakpoint in that, and calling it from the
DEFINE-INTERFACE callback doesn'
t seem to help.

I have a suspicion that the problem has to do with Cocoa not being
thread-safe.  If I put the breakpoint in a non-CAPI thread, the
Stepper does come up:

(define-interface foo ()
 ()
 (:panes
  (foo
   text-input-pane
   :callback (lambda (interface item)
               (mp:process-run-function "foo" '()
                (lambda ()
                  (format t "~D" (+ 1 (* 2 3)))))))))

I can place a breakpoint on the format and step to my heart's content.
 I hope that problems with Cocoa threading aren't the reason, though,
because then it's Cocoa's fault and not something I can work around.
:)

-- 
Bill Atkins


Pane still accepts focus when :accepts-focus-p is nil

In this function to display a color palette, why do the color display-panes
accept the focus and are tab stops even though :accepts-focus-p is nil.
This is with LW 4.4.6.  Thanks for any help.

Mitch

(defun palette-display ()
  (let ((color-list (color:apropos-color-names ""))
        (color-pane-list nil))
    (setf color-pane-list (mapcar #'(lambda (z)
                                      (make-instance
                                       'capi:display-pane
                                       :text nil
                                       :title (symbol-name z)
                                       :accepts-focus-p nil
                                       :title-position :right
                                       :external-min-height 30
                                       :external-min-width 100
                                       :background z)) color-list))
    (capi:contain
     (make-instance
      'capi:column-layout
      :internal-max-height 800
      :vertical-scroll t
      :description
      color-pane-list)))) 


Re: Breakpoints not firing in CAPI callbacks?

I think this a limitation of LispWorks on OS X. All interfaces  
(including LW interfaces) run in a single thread, so you can't use  
the stepper on interface code. I also suppose this is the reason that  
the interface building tool is not offered on OS X.


John



On Dec 22, 2006, at 1:31 AM, Bill Atkins wrote:

>
> Lispworks 5.0.1 on OS X.  Here is a trivial CAPI interface:



John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL


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