new function to perform the same actions as gtk_list_remove_items, but

Thu Feb  5 02:13:08 1998  Tim Janik  <timj@gimp.org>

        * gtk/gtklist.h:
        * gtk/gtklist.c (gtk_list_remove_items_no_unref): new function
          to perform the same actions as gtk_list_remove_items, but
          supply the removed widgets with an additional reference count.

        * gtk/gtkmain.c (gtk_main_iteration_do): ignore events
          with event_widget == NULL, since they are bogus events
          from destroyed GdkWindows, exept for the case where
          event->type==GDK_PROPERTY_NOTIFY. Always handle expired
          timeout functions when returning from this function.

        * gtk/gtkwidget.c (gtk_widget_event): ignore GDK_EXPOSE events
          if event->window == NULL. Also, if this function couldn't handle
          the event for any reason (including failing assumptions), make
          the return value to look as if the event had been handled to
          avoid further processing (and warnings).

        * gtk/gtkwidget.h:
        * gtk/gtkwidget.c: remove gtk_widget_sink, because there is
          no point in providing such a function.

        * gdk/gdk.c (gdk_init): changed options `-name' and `-class'
          to `--name' and `--class', because the old names would
          confuse getopt(). these arguments have been introduced in the
          changes from gtk+970916 to gtk+970925 without a ChangeLog entry,
          changing argument names is painful, it would be nice if people
          would care about compatibility and consistency in the first place!
This commit is contained in:
Tim Janik
1998-02-05 03:53:41 +00:00
committed by Tim Janik
parent f82814760e
commit 9258a7aecb
15 changed files with 390 additions and 97 deletions

View File

@ -1675,7 +1675,7 @@ gtk_widget_event (GtkWidget *widget,
gint return_val;
gint signal_num;
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (widget != NULL, TRUE);
gtk_widget_ref (widget);
return_val = FALSE;
@ -1709,9 +1709,6 @@ gtk_widget_event (GtkWidget *widget,
case GDK_DESTROY:
signal_num = DESTROY_EVENT;
break;
case GDK_EXPOSE:
signal_num = EXPOSE_EVENT;
break;
case GDK_KEY_PRESS:
signal_num = KEY_PRESS_EVENT;
break;
@ -1781,6 +1778,16 @@ gtk_widget_event (GtkWidget *widget,
case GDK_CLIENT_EVENT:
signal_num = CLIENT_EVENT;
break;
case GDK_EXPOSE:
/* there is no sense in providing a widget with bogus expose events
*/
if (!event->any.window)
{
gtk_widget_unref (widget);
return TRUE;
}
signal_num = EXPOSE_EVENT;
break;
default:
g_warning ("could not determine signal number for event: %d", event->type);
gtk_widget_unref (widget);
@ -2223,7 +2230,8 @@ gtk_widget_set_parent (GtkWidget *widget,
GtkStateData data;
g_return_if_fail (widget != NULL);
g_assert (widget->parent == NULL);
g_return_if_fail (widget->parent == NULL);
g_return_if_fail (!GTK_WIDGET_TOPLEVEL (widget));
g_return_if_fail (parent != NULL);
/* keep this function in sync with gtk_menu_attach_to_widget()
@ -3824,12 +3832,6 @@ gtk_widget_dnd_data_set (GtkWidget *widget,
gdk_window_dnd_data_set (widget->window, event, data, data_numbytes);
}
void
gtk_widget_sink (GtkWidget *widget)
{
gtk_object_sink (GTK_OBJECT (widget));
}
#undef gtk_widget_ref
#undef gtk_widget_unref