Spec: Setting rows height of a pictures list

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Spec: Setting rows height of a pictures list

Pharo Smalltalk Users mailing list
Hi,
        I've created a list of pictures, i.e. a widget based on ListModel where
each item is a ImageModel.

        When the widget is displayed I get list window with very thin rows.

        Is there a way to control the ListModel rows height?


Thanks,
Matteo

Reply | Threaded
Open this post in threaded view
|

Re: Spec: Setting rows height of a pictures list

Nicolai Hess-3-2


2016-10-31 10:19 GMT+01:00 Matteo via Pharo-users <[hidden email]>:


---------- Weitergeleitete Nachricht ----------
From: Matteo <[hidden email]>
To: "Pharo is welcome (ML)" <[hidden email]>
Cc: 
Date: Mon, 31 Oct 2016 10:18:03 +0100
Subject: Spec: Setting rows height of a pictures list
Hi,
        I've created a list of pictures, i.e. a widget based on ListModel where
each item is a ImageModel.

        When the widget is displayed I get list window with very thin rows.

        Is there a way to control the ListModel rows height?

Not if the images have different heights (you can, but it looks terrible, because the underlaying list morph does not work for list items with different heights).
 


Thanks,
Matteo



Reply | Threaded
Open this post in threaded view
|

Re: Spec: Setting rows height of a pictures list

Pharo Smalltalk Users mailing list
Thanks Nicolai,

        unfortunately, even using images of the same height I obtain a list
with thin rows. Maybe I'm typing something wrong.

        I'll try to figure out how to handle this.
        Please let me know, if you have any further suggestion.

Thanks,
Matteo


On 31/10/16 12:26, Nicolai Hess wrote:

>
>
> 2016-10-31 10:19 GMT+01:00 Matteo via Pharo-users
> <[hidden email] <mailto:[hidden email]>>:
>
>
>
>     ---------- Weitergeleitete Nachricht ----------
>     From: Matteo <[hidden email] <mailto:[hidden email]>>
>     To: "Pharo is welcome (ML)" <[hidden email]
>     <mailto:[hidden email]>>
>     Cc:
>     Date: Mon, 31 Oct 2016 10:18:03 +0100
>     Subject: Spec: Setting rows height of a pictures list
>     Hi,
>             I've created a list of pictures, i.e. a widget based on
>     ListModel where
>     each item is a ImageModel.
>
>             When the widget is displayed I get list window with very
>     thin rows.
>
>             Is there a way to control the ListModel rows height?
>
>
> Not if the images have different heights (you can, but it looks
> terrible, because the underlaying list morph does not work for list
> items with different heights).
>  
>
>
>
>     Thanks,
>     Matteo
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Spec: Setting rows height of a pictures list

Nicolai Hess-3-2


2016-10-31 15:07 GMT+01:00 Matteo via Pharo-users <[hidden email]>:


---------- Weitergeleitete Nachricht ----------
From: Matteo <[hidden email]>
To: Any question about pharo is welcome <[hidden email]>
Cc: 
Date: Mon, 31 Oct 2016 15:06:27 +0100
Subject: Re: [Pharo-users] Spec: Setting rows height of a pictures list
Thanks Nicolai,

        unfortunately, even using images of the same height I obtain a list
with thin rows. Maybe I'm typing something wrong.

        I'll try to figure out how to handle this.
        Please let me know, if you have any further suggestion.

Thanks,
Matteo


For Images with the same height/width, you can use #buildWithSpecLayout: in the displayBlock and
use a SpecTableLayout with the width/height of the image model image.

But this doesn't really work, somehow the list widget can not handle the selection and scrolling (but the images are shown in full size) :

imageModels :=  (1 to:10) collect:[:i | ImageModel new image: PolymorphSystemSettings pharoLogoForm].
listModel := ListModel new items: imageModels.
listModel displayBlock:[:item | | layout |
    layout := SpecTableLayout row add:#yourself; height: item image height; width: item image width.
    item buildWithSpecLayout: layout].
listModel openWithSpec

 

On 31/10/16 12:26, Nicolai Hess wrote:
>
>
> 2016-10-31 10:19 GMT+01:00 Matteo via Pharo-users
> <[hidden email] <mailto:[hidden email]>>:
>
>
>
>     ---------- Weitergeleitete Nachricht ----------
>     From: Matteo <[hidden email] <mailto:[hidden email]>>
>     To: "Pharo is welcome (ML)" <[hidden email]
>     <mailto:[hidden email]>>
>     Cc:
>     Date: Mon, 31 Oct 2016 10:18:03 +0100
>     Subject: Spec: Setting rows height of a pictures list
>     Hi,
>             I've created a list of pictures, i.e. a widget based on
>     ListModel where
>     each item is a ImageModel.
>
>             When the widget is displayed I get list window with very
>     thin rows.
>
>             Is there a way to control the ListModel rows height?
>
>
> Not if the images have different heights (you can, but it looks
> terrible, because the underlaying list morph does not work for list
> items with different heights).
>
>
>
>
>     Thanks,
>     Matteo
>
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Spec: Setting rows height of a pictures list

Pharo Smalltalk Users mailing list
Hi Nicolai,
        I think it would be great to have a specific ListModel for pictures,
like the IconListModel.

        Do you know if there's already someone working on a "picture" ListModel?
        Could I try to implement it, and its morphic adapter?

Thanks,
Matteo

On 31/10/16 15:20, Nicolai Hess wrote:

>
>
> 2016-10-31 15:07 GMT+01:00 Matteo via Pharo-users
> <[hidden email] <mailto:[hidden email]>>:
>
>
>
>     ---------- Weitergeleitete Nachricht ----------
>     From: Matteo <[hidden email] <mailto:[hidden email]>>
>     To: Any question about pharo is welcome <[hidden email]
>     <mailto:[hidden email]>>
>     Cc:
>     Date: Mon, 31 Oct 2016 15:06:27 +0100
>     Subject: Re: [Pharo-users] Spec: Setting rows height of a pictures list
>     Thanks Nicolai,
>
>             unfortunately, even using images of the same height I obtain
>     a list
>     with thin rows. Maybe I'm typing something wrong.
>
>             I'll try to figure out how to handle this.
>             Please let me know, if you have any further suggestion.
>
>     Thanks,
>     Matteo
>
>
> For Images with the same height/width, you can use #buildWithSpecLayout:
> in the displayBlock and
> use a SpecTableLayout with the width/height of the image model image.
>
> But this doesn't really work, somehow the list widget can not handle the
> selection and scrolling (but the images are shown in full size) :
>
> imageModels :=  (1 to:10) collect:[:i | ImageModel new image:
> PolymorphSystemSettings pharoLogoForm].
> listModel := ListModel new items: imageModels.
> listModel displayBlock:[:item | | layout |
>     layout := SpecTableLayout row add:#yourself; height: item image
> height; width: item image width.
>     item buildWithSpecLayout: layout].
> listModel openWithSpec
>
>  
>
>
>     On 31/10/16 12:26, Nicolai Hess wrote:
>     >
>     >
>     > 2016-10-31 10:19 GMT+01:00 Matteo via Pharo-users
>     > <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email]
>     <mailto:[hidden email]>>>:
>     >
>     >
>     >
>     >     ---------- Weitergeleitete Nachricht ----------
>     >     From: Matteo <[hidden email] <mailto:[hidden email]>
>     <mailto:[hidden email] <mailto:[hidden email]>>>
>     >     To: "Pharo is welcome (ML)" <[hidden email]
>     <mailto:[hidden email]>
>     >     <mailto:[hidden email]
>     <mailto:[hidden email]>>>
>     >     Cc:
>     >     Date: Mon, 31 Oct 2016 10:18:03 +0100
>     >     Subject: Spec: Setting rows height of a pictures list
>     >     Hi,
>     >             I've created a list of pictures, i.e. a widget based on
>     >     ListModel where
>     >     each item is a ImageModel.
>     >
>     >             When the widget is displayed I get list window with very
>     >     thin rows.
>     >
>     >             Is there a way to control the ListModel rows height?
>     >
>     >
>     > Not if the images have different heights (you can, but it looks
>     > terrible, because the underlaying list morph does not work for list
>     > items with different heights).
>     >
>     >
>     >
>     >
>     >     Thanks,
>     >     Matteo
>     >
>     >
>     >
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Spec: Setting rows height of a pictures list

stepharo



Le 5/11/16 à 15:59, Matteo via Pharo-users a écrit :

Re: [Pharo-users] Spec: Setting rows height of a pictures list.eml
Sujet :
Re: [Pharo-users] Spec: Setting rows height of a pictures list
De :
Matteo [hidden email]
Date :
5/11/16 15:53
Pour :
Any question about pharo is welcome [hidden email]

Hi Nicolai,
	I think it would be great to have a specific ListModel for pictures,
like the IconListModel.

	Do you know if there's already someone working on a "picture" ListModel?
Not that I know.
	Could I try to implement it, and its morphic adapter?

Sure!
Now pay attention that it is probably better to use FastTable on the morphic level.


Thanks,
Matteo

On 31/10/16 15:20, Nicol

Reply | Threaded
Open this post in threaded view
|

Re: Spec: Setting rows height of a pictures list

Pharo Smalltalk Users mailing list
I think the adaptor will called "MorphicImageFastTableAdaptor", and the model "ImageFastTableAdapter".

In the package "Spec-MorphicAdapters", the "MorphicFastTableAdapter" uses an object "FTPluggableIconListMorphAdaptor".

Could the "MorphicImageFastTableAdaptor" use directly a "FTTableMorph" object, instead of creating "pluggable" adapter?

cheers,
Matteo

On November 5, 2016 10:31:18 PM GMT+01:00, stepharo <[hidden email]> wrote:



Le 5/11/16 à 15:59, Matteo via Pharo-users a écrit :

Re: [Pharo-users] Spec: Setting rows height of a pictures list.eml
Sujet :
Re: [Pharo-users] Spec: Setting rows height of a pictures list
De :
Matteo [hidden email]
Date :
5/11/16 15:53
Pour :
Any question about pharo is welcome [hidden email]

Hi Nicolai,
 I think it would be great to have a specific ListModel for pictures,
like the IconListModel.

 Do you know if there's already someone working on a "picture" ListModel?
Not that I know.
 Could I try to implement it, and its morphic adapter?

Sure!
Now pay attention that it is probably better to use FastTable on the morphic level.


Thanks,
Matteo

On 31/10/16 15:20, Nicol

Reply | Threaded
Open this post in threaded view
|

Re: Spec: Setting rows height of a pictures list

stepharo
Matteo your emails format looks quite strange...


Le 8/11/16 à 14:27, Matteo via Pharo-users a écrit :
> I think the adaptor will called "MorphicImageFastTableAdaptor", and
> the model "ImageFastTableAdapter".
>
> In the package "Spec-MorphicAdapters", the "MorphicFastTableAdapter"
> uses an object "FTPluggableIconListMorphAdaptor".

I would say yes because as you I find this suboptimal.
Now may be it was created like that because of incompatibilities between
uses of PluggableIconListMorph (RIP) and FT.
Nothing is simple when you have legacy and different interaction protocol
>
> Could the "MorphicImageFastTableAdaptor" use directly a "FTTableMorph"
> object, instead of creating "pluggable" adapter?
Could you give a try and let us know.
I' super hyper fuulllllll (tomorrow 6 hours teaching).
>
> cheers,
> Matteo