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 |
2016-10-31 10:19 GMT+01:00 Matteo via Pharo-users <[hidden email]>:
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 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 > > > |
2016-10-31 15:07 GMT+01:00 Matteo via Pharo-users <[hidden email]>:
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
|
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 > > > > > > > > > |
Le 5/11/16 à 15:59, Matteo via
Pharo-users a écrit :
Not that I know.
Sure! Now pay attention that it is probably better to use FastTable on the morphic level.
|
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:
|
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 |
Free forum by Nabble | Edit this page |