Re: setting the selection in a clist



On 25 May 2001 18:28:09 -0400 Havoc Pennington <hp redhat com> wrote:

> 
> "Norman Black" <stonybrk ix netcom com> writes: 
> > How can I set the selection and "focus" item in a clist to the same item in
> > the list. There is no "set focus row" API call. I am using
> > gtk_clist_select_row to select an item in the clist.
> > 
> 
> I think some people in the past have managed this by poking around in
> the GtkCList struct internals. But I don't know specifics.

Hi,

since GTK-- has such a function, I looked up the source and found
out how it works. Here's it translated to C:

void gtk_clist_focus_row (GtkCList *clist, gint row)
{
    clist->focus_row = row;
    if (clist->freeze_count == 0)
        gtk_widget_draw (GTK_WIDGET (clist), NULL);
}

Cheers,
Daniel




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