gtk_clist_set_vadjustment()



Hi,

I am using GTK+1.2.10, I have some problem on "gtk_clist_set_vadjustment()".
Here is my code:

        if (GTK_IS_CLIST(l) && GTK_WIDGET_REALIZED(l) && g_list_length (GTK_CLIST(l)->selection) == 1){
                GtkAdjustment *adj;
                gint offset;
                offset = GPOINTER_TO_INT(GTK_CLIST(l)->selection->data);
                if ((GTK_CLIST(l) -> rows - offset)*GTK_CLIST(l) -> row_height <= GTK_CLIST(l) -> 
clist_window_height)
                        offset = GTK_CLIST(l) -> rows - (gint)(GTK_CLIST(l) -> clist_window_height/GTK_CLIST(l) 
-> row_height);
                if ((adj = gtk_clist_get_vadjustment(GTK_CLIST(l)))!=NULL){
                        g_print("%f::%f::%f =>> %d\n", adj -> value, adj -> upper, adj -> lower, (offset * 
(GTK_CLIST(l) -> row_height + 1)));
                        gtk_adjustment_set_value(GTK_ADJUSTMENT(adj), (gfloat)( offset * (GTK_CLIST(l) -> 
row_height + 1)));
                        gtk_clist_set_vadjustment(GTK_CLIST(l), GTK_ADJUSTMENT(adj));
                }
        }

I always can't set the expect adjustment.
Any simple example that illustrate the usage of "gtk_clist_set_vadjustment()"
Or any suggestion is also appreciate.
Thanks,

Kai




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