Re: patch for GtkDialog
- From: Charles Lambert <cwlambert76 yahoo com>
- To: James Willcox <jwillcox cs indiana edu>, Havoc Pennington <hp redhat com>
- Cc: gtk-devel-list gnome org, Seth Nickell <snickell stanford edu>, calum benson ireland sun com
- Subject: Re: patch for GtkDialog
- Date: Fri, 29 Mar 2002 16:22:23 -0800 (PST)
--- 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]