Patch to fix togglebuttons popping up
- From: Soeren Sandmann <sandmann daimi au dk>
- To: gtk-devel-list gnome org
- Subject: Patch to fix togglebuttons popping up
- Date: 30 May 2000 17:21:36 +0200
Togglebuttons currently pops up when the mouse enters them, even if
they are active. Here is a patch:
Index: gtktogglebutton.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktogglebutton.c,v
retrieving revision 1.25.2.1
diff -u -r1.25.2.1 gtktogglebutton.c
--- gtktogglebutton.c 2000/05/26 03:08:05 1.25.2.1
+++ gtktogglebutton.c 2000/05/30 15:00:23
@@ -401,11 +401,26 @@
gtk_toggle_button_expose (GtkWidget *widget,
GdkEventExpose *event)
{
- if (!GTK_WIDGET_NO_WINDOW (widget) &&
- GTK_WIDGET_CLASS (parent_class)->expose_event)
- return GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
- else
- return FALSE;
+ GtkBin *bin;
+ GdkEventExpose child_event;
+
+ g_return_val_if_fail (widget != NULL, FALSE);
+ g_return_val_if_fail (event != NULL, FALSE);
+ g_return_val_if_fail (GTK_IS_TOGGLE_BUTTON (widget), FALSE);
+
+ bin = GTK_BIN (widget);
+
+ if (GTK_WIDGET_DRAWABLE (widget))
+ {
+ gtk_toggle_button_paint (widget, &event->area);
+
+ child_event = *event;
+ if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) &&
+ gtk_widget_intersect (bin->child, &event->area, &child_event.area))
+ gtk_widget_event (bin->child, (GdkEvent*) &child_event);
+ }
+
+ return FALSE;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]