problematic gtk_clist_get_selection_info()



hi all,

the current semantics of gtk_clist_get_selection_info() are not very nice,
because it operates on anonymous relative coordinates.
the returned results are only valid if the coordinates actually came from
clist->clist_window, but the clist can receive button presses/releases from
other windows as well (e.g. the scrollbars).

the requirement of this knowledge is an unneccessary burden to the clist user,
to retrive correct results, he has to:

if (event->window == GTK_CLIST (clist)->clist_window &&
    gtk_clist_get_selection_info (GTK_CLIST (clist),
                                  event->x, event->y,
                                  &row, &column))
{ ... }

i'd therefore like to mark gtk_clist_get_selection_info() deprecated and
provide something like:

gint
gtk_clist_selection_info (GtkCList       *clist,
                          GdkWindow      *window,
                          gint            x,
                          gint            y,
                          gint           *row,
                          gint           *column)
{
  g_return_val_if_fail (clist != NULL, FALSE);
  g_return_val_if_fail (GTK_IS_CLIST (clist), FALSE);

  if (window && window == clist->clist_window)
    return gtk_clist_get_selection_info (clist, x, y, row, column);

  return FALSE;
}

objections/suggestions?

---
ciaoTJ



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