Lisp HUG Maillist Archive

some CAPI issues

#|
This is with LW 6.0.1 on windows XP

The code below makes a small interface for exploring the column layout. You click the button Run/Add to add some elements to a column layout.

I encounter three problems:

1.

Adding children is slow, and while children are added, I can not work with the children already displayed.

Even if the children added to the bottom are outside of the visible portion of the column, the visible children are not responsive.

I would be happy to receive some directions on how to efficiently add children outside of the visible portion of a pane while interacting with the elements already displayed.

2.

The children of the column-layout are simple-pinboard-layouts having motion and a left click callbacks.
The motion callback displays the text of a child in the message area and it shows a tooltip with same text.
If I click on one of the children its tooltip doesn't work any longer. The motion callback is still called since the message area is updated.

Do you have any ideas how to repair the tooltip ?

3.

The mouse wheel (optical usb) does not scroll the column layout. I can scroll editors and other IDE panes, however.

Based on this information: http://thread.gmane.org/gmane.lisp.lispworks.general/9852/focus=9890
I hoped it would work. Is there something I'm missing ?


I would be greatful to receive some help.

Frank Schorr

|#

(cl:defpackage #:column-test
  (:use #:capi #:common-lisp))

(in-package #:column-test)

(defparameter *interface* nil)

(define-interface column-test ()
  ((counter :accessor counter :initform 0))
  (:panes
   (column-pane column-layout
                :y-gap 0
                :vertical-scroll t
                :accessor column-pane)
   (add-button push-button
               :text "Run/Add"
               :callback 'add-button-callback
               :callback-type :interface)
   (restart-button push-button
                   :text "Restart"
                   :callback 'do-restart
                   :callback-type :item))
  (:layouts
   (buttons row-layout '(add-button restart-button))
   (main-layout column-layout '(buttons column-pane)))
  (:default-initargs
   :layout 'main-layout
   :best-width 200
   :best-height 400
   :message-area t))

(defun start-interface ()
  (setf *interface* (capi:display (make-instance 'column-test))))

(defun do-restart (item)
  (quit-interface item)
  (start-interface))

(defun add-button-callback (interface)
  (loop repeat 20 do
        ;; (sleep 0.2)
        (add-item (column-pane interface) (format nil "Text ~a" (incf (counter interface))))))

(defun press-callback (pane x y)
  (declare (ignore x y))
  (print (layout-description pane)))

(defun motion-callback (pane x y)
  (declare (ignore x y))
  (let ((text (title-pane-text (first (layout-description pane)))))
    (setf (titled-pane-message *interface*) text)
    (display-tooltip pane :text text :x 0 :y 0)))

(defun add-item (pane text)  
  (setf (layout-description pane)
        (append (layout-description pane)
                (list (make-instance 'simple-pinboard-layout
                                     :child (make-instance 'title-pane :text text)
                                     :input-model (list (list (list :button-1 :press) #'press-callback)
                                                        (list :motion #'motion-callback)))
                      :separator))))

#+run
(start-interface)

  

Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die   
Toolbar eingebaut! http://produkte.web.de/go/toolbar

Re: some CAPI issues

Frank Schorr wrote on Fri, 25 Feb 2011 23:37:37 +0100 (CET) 01:37:

| This is with LW 6.0.1 on windows XP

Generally, it is not a good idea to put lots of pinboard layouts into the
same interface. Why do not you place instances of capi:item-pinboard-object
into a single scrollable pinboard layout?

IMHO, the column-pane should be defined into the :layouts section instead of
the :panes.

I have tested on LWW 4.4.6 on Windows 2000. To me, the interface is quite
responsible anyway. See my comments below.

| 1. Adding children is slow, and while children are added, I can not work
| with the children already displayed.
|
| Even if the children added to the bottom are outside of the visible
| portion of the column, the visible children are not responsive.

Strange, every pane displayed keeps on working to me.

| 2. The children of the column-layout are simple-pinboard-layouts having
| motion and a left click callbacks. The motion callback displays the
| text of a child in the message area and it shows a tooltip with same
| text. If I click on one of the children its tooltip doesn't work any
| longer. The motion callback is still called since the message area is
| updated.
|
| Do you have any ideas how to repair the tooltip ?

I believe the tooltip should not pop-up the second time until you leave the
pane and move into it again.

| 3. The mouse wheel (optical usb) does not scroll the column layout. I can
| scroll editors and other IDE panes, however.

After I click to right of the text, the column layout receives focus and
mouse wheel works to me.
--
Sincerely,
Dmitriy Ivanov
lisp.ystok.ru


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