Forum > LCL

ListView do not show icons in Linux when ViewStyle:=vsIcon

(1/3) > >>

alejol0:
Control Listview works OK under Windows and behaves very bad in Linux. And some people have reported bad icon management of ListView in Mac OS.

This bug has more than 1 year without solution from Lazarus developer team.

I have reported newly this in:
http://bugs.freepascal.org/view.php?id=16238

The scenario is this:

    I have a ListView named ListView1 , two buttons Button1 and Button2,
two imagelist, ImageList1 and ImageList2.

ImageList1 contains 3 .png images of 16x16 pixels, Image2 has 3 .png of 48x48 pixels.

ListView has 3 items. It is configured to show 1 column in report mode.

ListView1 has SmallImages:=ImageList1 and LargeImages:=ImageList2.
Button1Click has only 1 line of code: ListView1.ViewStyle:=vsReport;
Button2Click has only 1 line: ListView1.ViewStyle:=vsIcon;

In Linux, the ListView do not show icons in mode vsIcon;
in Windows, same code show icons correctly.

In mode vsSmallIcons the control do not show anything (in Linux).

The problem occurs in Lazarus 0.9.28.2 beta with FPC 2.2.4 in Ubuntu 9.10 and in Puppy Linux 4.3.1. And was reported by another user using Lazarus 0.9.29 with FPC 2.5.1. I am convinced that it is not caused by gtk version. I think that the problem is a bug in ListView LCL component for Linux. Please correct me.

Does anybody know a workaround? Maybe some similar control
that can show icons in a list of elements in Linux?

Can contact me at: alejandro.lavarello (at) gmail . com

Paul Ishenin:
The listview problem can't be easy fixed. vsIcon listview style is simple not implemented for gtk2. Only vsReport style works. This is not a bug but a missing feature. Gtk has a GtkIconView widget which can be used for vsIcon style but again this is not implemented in LCL.

alejol0:

--- Quote from: Paul Ishenin on April 15, 2010, 08:22:17 am ---The listview problem can't be easy fixed. vsIcon listview style is simple not implemented for gtk2. Only vsReport style works. This is not a bug but a missing feature. Gtk has a GtkIconView widget which can be used for vsIcon style but again this is not implemented in LCL.

--- End quote ---
I am a newbie in Lazarus.
Seeing in the Lazarus bugtracker, I have show that some controls have been
improved to work with some operating systems or widgetset to work equal
to Windows equivalent, but ListView still working bad in Linux.

Can you show me some workaround? Maybe not using Gtk2... Or some similar control for Lazarus...

I use Ubuntu 9.10 and Puppy Linux 4.3.1 for Lazarus development. Ubuntu 9.10 and Puppy has lot of applications (not developed in Lazarus) using
controls similar to ListView , working well in vsIcon style. Should I switch to another programming language?

Paul Ishenin:
Instead of switching to another language you can try to implement the missing style support for gtk2. You have all the sources of Lazarus so nothing stops you to start hacking the code right now :)

alejol0:

--- Quote from: Paul Ishenin on April 16, 2010, 01:15:09 am ---Instead of switching to another language you can try to implement the missing style support for gtk2. You have all the sources of Lazarus so nothing stops you to start hacking the code right now :)

--- End quote ---
Thanks Paul! Very helpful! (ironic)
I do not know how to rebuild a component.
I have believed in the Lazarus motto "write once, compile everywhere".
But you show me that this is false. It is "use Windows, or you can
still for years that Lazarus team correct bugs in Linux".

Navigation

[0] Message Index

[#] Next page

Go to full version