+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!
+
Tue Feb 3 15:09:55 1998 Tim Janik <timj@gimp.org>
+
+ * docs/widget_system.txt: new file containing notes about
+ the inner workings of the widget system of GTK+, a widget
+ flag description and certain invariants about widget states.
+
+ * docs/refcounting.txt: moved file (previously REFCOUNTING)
+ introducing The Reference Counting Scheme of GDK an GTK+.
+ lots of additions/corrections.
* gtk/gtksignal.c (gtk_signal_real_emit): for the emission
of AFTER signals, fetch the objects signals via
* gtk/testgtk.c: some changes because of all the above ;)
->>>>>>> 1.103
Sat Jan 31 21:26:27 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised
+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!
+
Tue Feb 3 15:09:55 1998 Tim Janik <timj@gimp.org>
+
+ * docs/widget_system.txt: new file containing notes about
+ the inner workings of the widget system of GTK+, a widget
+ flag description and certain invariants about widget states.
+
+ * docs/refcounting.txt: moved file (previously REFCOUNTING)
+ introducing The Reference Counting Scheme of GDK an GTK+.
+ lots of additions/corrections.
* gtk/gtksignal.c (gtk_signal_real_emit): for the emission
of AFTER signals, fetch the objects signals via
* gtk/testgtk.c: some changes because of all the above ;)
->>>>>>> 1.103
Sat Jan 31 21:26:27 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised
+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!
+
Tue Feb 3 15:09:55 1998 Tim Janik <timj@gimp.org>
+
+ * docs/widget_system.txt: new file containing notes about
+ the inner workings of the widget system of GTK+, a widget
+ flag description and certain invariants about widget states.
+
+ * docs/refcounting.txt: moved file (previously REFCOUNTING)
+ introducing The Reference Counting Scheme of GDK an GTK+.
+ lots of additions/corrections.
* gtk/gtksignal.c (gtk_signal_real_emit): for the emission
of AFTER signals, fetch the objects signals via
* gtk/testgtk.c: some changes because of all the above ;)
->>>>>>> 1.103
Sat Jan 31 21:26:27 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised
+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!
+
Tue Feb 3 15:09:55 1998 Tim Janik <timj@gimp.org>
+
+ * docs/widget_system.txt: new file containing notes about
+ the inner workings of the widget system of GTK+, a widget
+ flag description and certain invariants about widget states.
+
+ * docs/refcounting.txt: moved file (previously REFCOUNTING)
+ introducing The Reference Counting Scheme of GDK an GTK+.
+ lots of additions/corrections.
* gtk/gtksignal.c (gtk_signal_real_emit): for the emission
of AFTER signals, fetch the objects signals via
* gtk/testgtk.c: some changes because of all the above ;)
->>>>>>> 1.103
Sat Jan 31 21:26:27 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised
+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!
+
Tue Feb 3 15:09:55 1998 Tim Janik <timj@gimp.org>
+
+ * docs/widget_system.txt: new file containing notes about
+ the inner workings of the widget system of GTK+, a widget
+ flag description and certain invariants about widget states.
+
+ * docs/refcounting.txt: moved file (previously REFCOUNTING)
+ introducing The Reference Counting Scheme of GDK an GTK+.
+ lots of additions/corrections.
* gtk/gtksignal.c (gtk_signal_real_emit): for the emission
of AFTER signals, fetch the objects signals via
* gtk/testgtk.c: some changes because of all the above ;)
->>>>>>> 1.103
Sat Jan 31 21:26:27 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised
+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!
+
Tue Feb 3 15:09:55 1998 Tim Janik <timj@gimp.org>
+
+ * docs/widget_system.txt: new file containing notes about
+ the inner workings of the widget system of GTK+, a widget
+ flag description and certain invariants about widget states.
+
+ * docs/refcounting.txt: moved file (previously REFCOUNTING)
+ introducing The Reference Counting Scheme of GDK an GTK+.
+ lots of additions/corrections.
* gtk/gtksignal.c (gtk_signal_real_emit): for the emission
of AFTER signals, fetch the objects signals via
* gtk/testgtk.c: some changes because of all the above ;)
->>>>>>> 1.103
Sat Jan 31 21:26:27 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised
+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!
+
Tue Feb 3 15:09:55 1998 Tim Janik <timj@gimp.org>
+
+ * docs/widget_system.txt: new file containing notes about
+ the inner workings of the widget system of GTK+, a widget
+ flag description and certain invariants about widget states.
+
+ * docs/refcounting.txt: moved file (previously REFCOUNTING)
+ introducing The Reference Counting Scheme of GDK an GTK+.
+ lots of additions/corrections.
* gtk/gtksignal.c (gtk_signal_real_emit): for the emission
of AFTER signals, fetch the objects signals via
* gtk/testgtk.c: some changes because of all the above ;)
->>>>>>> 1.103
Sat Jan 31 21:26:27 1998 Owen Taylor <owt1@cornell.edu>
* gtk/gtkwidget.c: Added a new GTK_IN_REPARENT flag and revised
gtk_widget_unref (GTK_WIDGET (tmp->data));
g_slist_free_1 (tmp);
}
+
+ /* Alternatively to the removal above you could just use
+ * gtk_list_remove_items_no_unref() which will add the additional
+ * reference count to the widget.
+ */
+ gtk_list_remove_items_no_unref (list, item_list);
+ gtk_list_prepend_items (other_list, item_list);
Now a (hopefully) complete list of functions that require
currently are (and correspond to the trailing signals):
GDK_SELECTION_CLEAR GtkWidget::selection_clear_event
-GDK_EXPOSE GtkWidget::expose_event
GDK_FOCUS_CHANGE GtkWidget::focus_in_event
GtkWidget::focus_out_event
(*argv)[i] = NULL;
}
}
- else if (strcmp ("-name", (*argv)[i]) == 0)
+ else if (strcmp ("--name", (*argv)[i]) == 0)
{
if ((i + 1) < *argc)
{
(*argv)[i] = NULL;
}
}
- else if (strcmp ("-class", (*argv)[i]) == 0)
+ else if (strcmp ("--class", (*argv)[i]) == 0)
{
if ((i + 1) < *argc)
{
(*argv)[i] = NULL;
}
}
- else if (strcmp ("-name", (*argv)[i]) == 0)
+ else if (strcmp ("--name", (*argv)[i]) == 0)
{
if ((i + 1) < *argc)
{
(*argv)[i] = NULL;
}
}
- else if (strcmp ("-class", (*argv)[i]) == 0)
+ else if (strcmp ("--class", (*argv)[i]) == 0)
{
if ((i + 1) < *argc)
{
gtk_list_insert_items (list, items, 0);
}
-void
-gtk_list_remove_items (GtkList *list,
- GList *items)
+static void
+gtk_list_remove_items_internal (GtkList *list,
+ GList *items,
+ gboolean no_unref)
{
GtkWidget *widget;
GList *selected_widgets;
GList *tmp_list;
-
+
g_return_if_fail (list != NULL);
g_return_if_fail (GTK_IS_LIST (list));
-
+
tmp_list = items;
selected_widgets = NULL;
widget = NULL;
-
+
while (tmp_list)
{
widget = tmp_list->data;
tmp_list = tmp_list->next;
-
+
if (widget->state == GTK_STATE_SELECTED)
selected_widgets = g_list_prepend (selected_widgets, widget);
-
+
list->children = g_list_remove (list->children, widget);
-
+
if (GTK_WIDGET_MAPPED (widget))
gtk_widget_unmap (widget);
-
+
+ if (no_unref)
+ gtk_widget_ref (widget);
gtk_widget_unparent (widget);
}
-
+
if (selected_widgets)
{
tmp_list = selected_widgets;
{
widget = tmp_list->data;
tmp_list = tmp_list->next;
-
+
gtk_list_unselect_child (list, widget);
}
-
+
gtk_signal_emit (GTK_OBJECT (list), list_signals[SELECTION_CHANGED]);
}
-
+
g_list_free (selected_widgets);
-
+
if (list->children && !list->selection &&
(list->selection_mode == GTK_SELECTION_BROWSE))
{
widget = list->children->data;
gtk_list_select_child (list, widget);
}
-
+
if (GTK_WIDGET_VISIBLE (list))
gtk_widget_queue_resize (GTK_WIDGET (list));
}
+void
+gtk_list_remove_items (GtkList *list,
+ GList *items)
+{
+ gtk_list_remove_items_internal (list, items, FALSE);
+}
+
+void
+gtk_list_remove_items_no_unref (GtkList *list,
+ GList *items)
+{
+ gtk_list_remove_items_internal (list, items, TRUE);
+}
+
void
gtk_list_clear_items (GtkList *list,
gint start,
};
-guint gtk_list_get_type (void);
-GtkWidget* gtk_list_new (void);
-void gtk_list_insert_items (GtkList *list,
- GList *items,
- gint position);
-void gtk_list_append_items (GtkList *list,
- GList *items);
-void gtk_list_prepend_items (GtkList *list,
- GList *items);
-void gtk_list_remove_items (GtkList *list,
- GList *items);
-void gtk_list_clear_items (GtkList *list,
- gint start,
- gint end);
-void gtk_list_select_item (GtkList *list,
- gint item);
-void gtk_list_unselect_item (GtkList *list,
- gint item);
-void gtk_list_select_child (GtkList *list,
- GtkWidget *child);
-void gtk_list_unselect_child (GtkList *list,
- GtkWidget *child);
-gint gtk_list_child_position (GtkList *list,
- GtkWidget *child);
-void gtk_list_set_selection_mode (GtkList *list,
- GtkSelectionMode mode);
+guint gtk_list_get_type (void);
+GtkWidget* gtk_list_new (void);
+void gtk_list_insert_items (GtkList *list,
+ GList *items,
+ gint position);
+void gtk_list_append_items (GtkList *list,
+ GList *items);
+void gtk_list_prepend_items (GtkList *list,
+ GList *items);
+void gtk_list_remove_items (GtkList *list,
+ GList *items);
+void gtk_list_remove_items_no_unref (GtkList *list,
+ GList *items);
+void gtk_list_clear_items (GtkList *list,
+ gint start,
+ gint end);
+void gtk_list_select_item (GtkList *list,
+ gint item);
+void gtk_list_unselect_item (GtkList *list,
+ gint item);
+void gtk_list_select_child (GtkList *list,
+ GtkWidget *child);
+void gtk_list_unselect_child (GtkList *list,
+ GtkWidget *child);
+gint gtk_list_child_position (GtkList *list,
+ GtkWidget *child);
+void gtk_list_set_selection_mode (GtkList *list,
+ GtkSelectionMode mode);
#ifdef __cplusplus
gdk_event_free (event);
gdk_event_free (next_event);
next_event = NULL;
-
- return done;
+
+ goto event_handling_done;
}
-
- /* Push the event onto a stack of current events for
- * gtk_current_event_get().
- */
- current_events = g_list_prepend (current_events, event);
/* Find the widget which got the event. We store the widget
* in the user_data field of GdkWindow's.
+ * Ignore the event if we don't have a widget for it, except
+ * for GDK_PROPERTY_NOTIFY events which are handled specialy.
+ * Though this happens rarely, bogus events can occour
+ * for e.g. destroyed GdkWindows.
*/
event_widget = gtk_get_event_widget (event);
+ if (!event_widget)
+ {
+ /* To handle selection INCR transactions, we select
+ * PropertyNotify events on the requestor window and create
+ * a corresponding (fake) GdkWindow so that events get
+ * here. There won't be a widget though, so we have to handle
+ * them specially
+ */
+ if (event->type == GDK_PROPERTY_NOTIFY)
+ gtk_selection_incr_event (event->any.window,
+ &event->property);
+
+ gdk_event_free (event);
+
+ goto event_handling_done;
+ }
+
+ /* Push the event onto a stack of current events for
+ * gtk_current_event_get().
+ */
+ current_events = g_list_prepend (current_events, event);
/* If there is a grab in effect...
*/
break;
case GDK_PROPERTY_NOTIFY:
- /* To handle selection INCR transactions, we select
- * PropertyNotify events on the requestor window and create
- * a corresponding (fake) GdkWindow so that events get
- * here. There won't be a widget though, so we have to handle
- * them specially
- */
-
- if (event_widget == NULL)
- {
- gtk_selection_incr_event (event->any.window,
- &event->property);
- break;
- }
- /* otherwise fall through */
case GDK_EXPOSE:
case GDK_NO_EXPOSE:
case GDK_FOCUS_CHANGE:
break;
case GDK_ENTER_NOTIFY:
- if (grab_widget && GTK_WIDGET_IS_SENSITIVE (grab_widget))
+ if (GTK_WIDGET_IS_SENSITIVE (grab_widget))
{
gtk_widget_event (grab_widget, event);
if (event_widget == grab_widget)
GTK_PRIVATE_SET_FLAG (event_widget, GTK_LEAVE_PENDING);
}
break;
-
+
case GDK_LEAVE_NOTIFY:
- if (event_widget && GTK_WIDGET_LEAVE_PENDING (event_widget))
+ if (GTK_WIDGET_LEAVE_PENDING (event_widget))
{
GTK_PRIVATE_UNSET_FLAG (event_widget, GTK_LEAVE_PENDING);
gtk_widget_event (event_widget, event);
}
- else if (grab_widget && GTK_WIDGET_IS_SENSITIVE (grab_widget))
+ else if (GTK_WIDGET_IS_SENSITIVE (grab_widget))
gtk_widget_event (grab_widget, event);
break;
}
tmp_list = current_events;
current_events = g_list_remove_link (current_events, tmp_list);
g_list_free_1 (tmp_list);
-
+
gdk_event_free (event);
}
else
gtk_handle_idle ();
}
- /* Handle a timeout functions that may have expired.
+event_handling_done:
+
+ /* Handle timeout functions that may have expired.
*/
gtk_handle_timeouts ();
gtk_grab_add (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
-
+
if (!GTK_WIDGET_HAS_GRAB (widget))
{
GTK_WIDGET_SET_FLAGS (widget, GTK_HAS_GRAB);
gtk_grab_remove (GtkWidget *widget)
{
g_return_if_fail (widget != NULL);
-
+
if (GTK_WIDGET_HAS_GRAB (widget))
{
GTK_WIDGET_UNSET_FLAGS (widget, GTK_HAS_GRAB);
-
+
grabs = g_slist_remove (grabs, widget);
gtk_widget_unref (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;
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;
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);
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()
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
GtkWidget* gtk_widget_newv (guint type,
guint nargs,
GtkArg *args);
-void gtk_widget_sink (GtkWidget *widget);
void gtk_widget_ref (GtkWidget *widget);
void gtk_widget_unref (GtkWidget *widget);
void gtk_widget_destroy (GtkWidget *widget);