Re: GtkClist

Neo <defcon5 ec-red com> writes:


I have a problem:
My program has a Gtkclist sorted in ascending mode.Each time i
add a code ,for example code 1,this code appears in row 1.Code 2
in row 2,like that...
But the problem is that when i add code 10,the code appears in row 2!!!
Is there any way to put the 10th code in row 10??? how can i
sort this type of gtkclist??

There are 2 ways you can do this.

1) you can write a custom sort function add add it to the clist using
   gtk_clist_compare_func ().  This function should give you the
   flexibility to sort it however you want.

2) You can add a second column; make it invisible, and set it to be the
   sort column.  Then, put lexically sortable numbers in the column.  As
   an example:

Column 1 (visible)  |  Column 2 (sorted and Invisible)
 "Code 1"           |  "001"
 "Code 2"           |  "002"
 "Code 3"           |  "003"
 "Code 4"           |  "004"
 "Code 5"           |  "005"
 "Code 6"           |  "006"
 "Code 7"           |  "007"
 "Code 8"           |  "008"
 "Code 9"           |  "009"
 "Code 10"          |  "010"


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