Re: patch for GtkDialog



--- James Willcox <jwillcox cs indiana edu> wrote:
> +static gboolean
> +gtk_dialog_has_cancel (GtkDialog *dialog)
> +{
> +  GList *children, *tmp_list;
> +  gboolean ret = FALSE;
> +      
> +  tmp_list = children = gtk_container_get_children
> (GTK_CONTAINER (dialog->action_area));
> +
> +  while (tmp_list)
> +  {
> +    GtkWidget *widget = tmp_list->data;
> +    ResponseData *rd = get_response_data (widget);
> +
> +    if (rd && rd->response_id ==
> GTK_RESPONSE_CANCEL)
> +    {
> +      ret = TRUE;
> +      break;
> +    }
> +
> +    tmp_list = g_list_next (tmp_list);
> +  }
> +
> +  g_list_free (children);
> +
> +  return ret;
>  }

your test should be:
if ( (NULL == rd) && (rd->response_id ==
GTK_RESPONSE_CANCEL) )


NULL isn't guarenteed to be equal to zero
(and yes i know i'm a perenthesis freak)

Charles Lambert

__________________________________________________
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/



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