Lisp HUG Maillist Archive

Adding pinboard-objects to a pinboard-layout

Hi,

Suppose I have a lot of (say, 1000) pinboard-objects that I want to add to
a pinboard-layout. I want them to appear on top of the stuff that's already
in the layout. I think that using something like the following would be
the 'official way' to do this:

  (loop for object in pinboard-objects
        do (capi:manipulate-pinboard pinboard-layout object :add-top))

Unfortunately, this is too slow when I have a lot of these objects.
(I suppose I'm getting some quadratic time dependency on the number
of objects.)

The only alternative I can think of is to use:

  (setf (capi:layout-description pinboard-layout)
        (append (capi:layout-description pinboard-layout)
                pinboard-objects)))

This seems to work and it's lots faster, but I can't find anything in the
documentation that says that the appended pinboard-objects are actually on
top of what's already there. And it seems to defeat the purpose of CAPI's
MANIPULATE-PINBOARD function.

Thanks in advance for any suggestions.

Regards,

Arthur Lemmens


RE: Adding pinboard-objects to a pinboard-layout

Hi,

did you tried putting you loop statement inside a "with-atomic-redisplay"
form ?

Sebastien.

> Hi,
>
> Suppose I have a lot of (say, 1000) pinboard-objects that I want to add to
> a pinboard-layout. I want them to appear on top of the stuff
> that's already
> in the layout. I think that using something like the following would be
> the 'official way' to do this:
>
>   (loop for object in pinboard-objects
>         do (capi:manipulate-pinboard pinboard-layout object :add-top))
>
> Unfortunately, this is too slow when I have a lot of these objects.
> (I suppose I'm getting some quadratic time dependency on the number
> of objects.)
>
> The only alternative I can think of is to use:
>
>   (setf (capi:layout-description pinboard-layout)
>         (append (capi:layout-description pinboard-layout)
>                 pinboard-objects)))
>
> This seems to work and it's lots faster, but I can't find anything in the
> documentation that says that the appended pinboard-objects are actually on
> top of what's already there. And it seems to defeat the purpose of CAPI's
> MANIPULATE-PINBOARD function.
>
> Thanks in advance for any suggestions.
>
> Regards,
>
> Arthur Lemmens
>
>


Unable to render article 1733 because of ":DEFAULT stream decoding error on #<SB-SYS:FD-STREAM for \"socket 192.168.43.216:64848, peer: 116.202.254.214:119\" {1006974AB3}>: the octet sequence #(233 98 97) cannot be decoded." error

Re: Adding pinboard-objects to a pinboard-layout

Unable to parse email body. Email id is 1735

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