gtkclist patch



undeterred by the silence regarding my gtktext patches,
here's a suggestion for gtkclist. i find that when rebuilding
a list but trying to retain the current selection (assuming
that the current row still exists in the rebuilt list) it looks
odd for the focus to be drawn around row 0.

this patch changes clist's behaviour so that the last
item to have been selected by code becomes the
focus row. this probably isn't the right behaviour
either, but it works well in cases where only one
row is selected, and seems more sensible than the
current behaviour which causes row 0 to get the
focus.

i know that we can set clist->focus_row ourselves,
but i'm very uncomfortable with the amount of
access to fields that goes on in GTK applications.
if anything, i'd rather have gtk_clist_set_focus_row
and gtk_clist_get_focus_row functions.

*** gtkclist.c	Fri Apr 30 13:48:41 1999
--- gtkclist.enh	Wed Aug 18 19:36:06 1999
***************
*** 3672,3677 ****
--- 3672,3679 ----
      clist->selection_end = 
        g_list_append (clist->selection_end, GINT_TO_POINTER (row))->next;
    
+   clist->focus_row = row;
+   
    if (CLIST_UNFROZEN (clist)
        && (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_NONE))
      GTK_CLIST_CLASS_FW (clist)->draw_row (clist, NULL, row, clist_row);

-- 
"Intelligence ... has caused our troubles; but it is not
 unintelligence that will cure them." -- Bertrand Russell



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