Lisp HUG Maillist Archive

Anyone has examples of how to use list-view?

Hi! Does anyone know where i can get some working example for the list-view pane? The information on the list-view reference page is quite sparse and i can't seem to find any code using it in the examples directory that ships with LW. I'm on LWW5.1.

Cheers,

Alex Paes

Re: Anyone has examples of how to use list-view?

Unable to parse email body. Email id is 10168

Re: Anyone has examples of how to use list-view?

Re: Anyone has examples of how to use list-view? Here is a simple example :

(capi:contain
 (make-instance 'capi:tree-view
                :callback-type :item-interface
                :roots '(("Foo" (:a 1 2) (:b 3 4) ) ("Bar" (:c 5 6) (:d 7 8)))
                :children-function #'(lambda (item) (when (listp item) (cdr item)))
                :print-function #'(lambda (item) (cond ((and (listp item) (listp (cadr item))) (car item))
                                                       ((listp item) (string (car item)))
                                                       (t (format nil "~d" item))))
                :selection-callback #'(lambda (item interface) (print item)) ;print the item when clicked
                :expandp-function #'(lambda (i) (declare (ignore i)) nil) ;replace nil by T to start with the tree fully expanded
                :image-lists nil ;a list of images
                :image-function #'(lambda (item) nil) ;a function to set the image according to the item
                :vertical-scroll t
                :visible-min-height 75))

Best
Denis

Le 8/04/10 18:51, « [NOM] » <[ADRESSE]> a écrit :

Hi! Does anyone know where i can get some working example for the list-view pane? The information on the list-view reference page is quite sparse and i can't seem to find any code using it in the examples directory that ships with LW. I'm on LWW5.1.

Cheers,

Alex Paes



-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------

Re: Anyone has examples of how to use list-view?

Hi all,

@Paul:
I've read your post from 25th Oct. and although i consider myself a capi newbie (more of a Lisp newbie actually) i have managed to get around to working with most of the capi panes and layouts even if always struggling to get the results i want.

@Denis:
I appreciate your example but i'm having real problem is dealing with LIST-VIEW not TREE-VIEW (will get to it eventually).

Here are some of the things bothering me with LIST-VIEW, i'm using it with as :REPORT view.

a) I wish it could behave a little more multi-column-panel where the whole row gets highlighted instead of just the first column field

b) Can't understand how the state images work. I added image-lists as explained in the documentation both :small and :state which are supposed to be used as small-image and state-image respectively, i also provided :image-function and :state-image-function functions as initargs but when calling capi:redisplay-collection-item the state-image simply disappears while the small-image gets updated correctly. What's the purpose of state images then?

c) multi-column-panel allows one to specify callbacks for clicking on the column headers (through :header-args initarg), is it just me or this should be an expected behavior?

Overall i wanted a multi-column-panel that allowed for an image on the first column so that it's easier to denote a given item's state (awaiting, processing, processed). I'm completely aware of ystok-grid but i hoped capi would provid facilities for such a thing.

Cheers,

Alex Paes

Re: Anyone has examples of how to use list-view?

> LIST-VIEW not TREE-VIEW

Oups...sorry, I read your message too quickly.


-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



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