[Lazarus] GTK TlistView

Michael Thompson mike.cornflake at gmail.com
Sun Aug 7 20:38:36 CEST 2011


G'day,

Apologies if this is the wrong place to ask this question - the forum seems
quiet on related questions I've asked there.

I've been playing with the GTK TListView code, and I'm happy I can solve
most of the selection issues outstanding in Mantis, and a few more to boot.
Problem is the solution for the TListView in Icon Mode is potentially quite
expensive - currently looping linearly over an unsorted TStringList
(ItemCache) of selected nodes every selection event (and there's one or two
existing scenarios where this happens as well).  Before I submit the patch
I'd like to optimise this code using a sorted integer list or two (side by
side with ItemCache).  Someone on the forums pointed me to a syntax I was
previously unfamiliar with, that I'd like to use.

uses
  fgl;

type
// for {$mode objfpc}
  TIntegerList = specialize TFPGList<Integer>;


My problem is that when I go into fgl it states this is prototype code - and
to me that means either the interface or implementation is likely to change
in the future.

My question is, are you guys happy if I go ahead and implement code inside
gtk2wscustomlistview.inc that uses this functionality, or should I just stay
on the safe side and implement a specific TIntegerList for this scenario?

The more I play with the gtk2 TListView, the more I realise what a superb,
but extremely difficult, job other people have done making the gtk2 widget
conform to the win32 api structure.   I imagine similar difficulties were
encountered in other widgetsets and my hat is off to all who have worked
through this.  Felipes suggestion of a custom drawn ListView looks more and
more attractive to me :-)

(this will be my first time playing with the LCL code, and I'm fully
expecting my patch to be rejected, or at least marked with red pen "must try
harder" :-) - just saying don't panic that you've got a newbie playing in
the LCL :-) )

Cheers

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20110807/fac5fb53/attachment-0002.html>


More information about the Lazarus mailing list