[gtk-list] Wish before 1.0 - clist




As 1.0 will be released soon now (well, sooner than I expected), i'd
like to make a couple of comments on the clist widget.

According to me the clist widget is bloated.
In clist you have a column list widget + a wiewport widget + a
scrolledwindow widget.
What do we gain with this?
 - scroll is maybe slightly faster (read more before reply now :))
 - when resizing the column widget (add / remove entry) we *may*
   avoid an expose event.

For the standard user, who will test list+scrolledwindow instead 
of the clist, the difference with scroll speed is quite amazing.
Why?
Because the clist expose event is well designed (at least compared
to the list widget).
As the list entries in the clist are "gadgets" (their drawing is
handled by the clist, not the entry itself), and are all of the
same size (at least height), you can know exactly which entries
need to be redrawn when an expose event occur.
This is not the case of the list widget (in which entries are widget),
which send the expose event to *all* its children (even if the child
is NOT visible).

This is the reason why the clist is much more efficient than the list+
acrolledwindow.

I wanted to modify the clist widget to test this theory, but infortunatly
I have too much work now to do it (can't code on gtk before 2 weeks :().

What should be done before 1.0?
clist should not have its own scrollbars and viewport. the acrolledwindow
already do that. The speed gain is due to the expose event of clist,
not the bypassing of scrolledwindow.

Why should it be done?
the scrollbars handling + viewport bloat the clist code.
scrolled window is useless if people bypass it to include it in
their own widget.
This is a bad example for gtk 1.0 users.
This makes the clist widget design inconsistent with the other widgets
of gtk.

I can here some of you answer "We can't delay 1.0 more".
I really can't say you're wrong.
But think about this:

When 1.0 will be out, a lot of new users will look at it and use it (cool).
They'll use the clist widget (never the list widget) (cool).
So, first, if you wan't to change the behaviour of clist in 1.1, you'll
have to change all the programs using clist (a lot of them).
Now, let say I'm a new user.
I need a list widget doing something a bit different than clist so I need
to write my own widget... How can I do it?
 - look at clist widget (efficient) and write my widget using its code.
 - or look at scrolled-window, and list widget which are inefficient
   (nobody use it, and as a user I won't look in the sources to find
   the reason *why* it is so inefficient).


I wanted to make the patch to change this but as I won't have enough
time to finish it and submit it before 1.0, I post this to the list.

I hope some of you will understand the reasons why I don't like the
current implementation of the clist widget.


Just my $0.25.

Patrice.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]