GtkD - how to list 0..100K strings [solved]

Kagamin spam at here.lot
Tue Apr 28 18:46:18 UTC 2020


On Monday, 27 April 2020 at 10:28:04 UTC, mark wrote:
> I renamed the class shown in my previous post from View to 
> InnerView, then created a new View class:
>
> class View : ScrolledWindow {
>     import qtrac.debfind.modelutil: NameAndDescription;
>
>     InnerView innerView;
>
>     this() {
>         super();
>         innerView = new InnerView;
>         addWithViewport(innerView);
>     }
>
>     void clear() {
>         innerView.viewData.clear;
>     }
>
>     void populate(NameAndDescription[] namesAndDescriptions) {
>         innerView.viewData.populate(namesAndDescriptions);
>     }
> }

Try this:

     void populate(NameAndDescription[] namesAndDescriptions) {
         
if(namesAndDescriptions.length>100)namesAndDescriptions=namesAndDescriptions[0..100];
         innerView.viewData.populate(namesAndDescriptions);
     }


More information about the Digitalmars-d-learn mailing list