note for "GNOME tips and tricks" was Re: sorting a clist?
- From: Dirk Luetjens <dirk luedi oche de>
- To: robert havoc pennington <rhpennin midway uchicago edu>
- cc: jb <jbnivoit ix netcom com>, gnome-list gnome org
- Subject: note for "GNOME tips and tricks" was Re: sorting a clist?
- Date: Sun, 28 Jun 1998 16:16:41 +0200 (CEST)
this is worth a note on the "GNOME tips and tricks" page.
On Sun, 28 Jun 1998, robert havoc pennington wrote:
> On Sun, 28 Jun 1998, jb wrote:
> > The question is in the title... how do i sort a clist on one of its
> > columns?
> Gtk doesn't provide a way. You'd just sort the text and then move the rows
> accordingly. There are probably hundreds of possible ways to do it.
> Get the text from all the rows and store it
> Freeze the list
> Clear the list
> Sort the text with your favorite algorithm
> Add all the rows back in order
> Thaw the list.
> Freeze/thaw make this look like it all happens at once, the user won't see
> the columns disappear and come back one by one.
> You could probably sort without recreating rows with swap_rows, but
> there's no good reason to I wouldn't think.
> Havoc Pennington ==== http://pobox.com/~hp
> To unsubscribe: mail email@example.com with
> "unsubscribe" as the Subject.
] [Thread Prev