RE: Question about GtkButton->event_window.



I still confuse:

1: The Xwindow don't need a bigger window to catch
"enter-notify"/"leave-notify" events.

2: The GtkButton->event_window covers the area of button in
GtkWidget->window, All the draw on GtkWidget->window should be covered.

3: the GtkButton need a gdk window,
(GTK_WIDGET_FLAGS(GTK_WIDGET(button)) & GTK_NO_WINDOW) should return
FALSE.

Thanks.

Tom




-----Original Message-----
From: gtk-app-devel-list-admin gnome org [mailto:gtk-app-devel-list-
admin gnome org] On Behalf Of Tristan Van Berkom
Sent: Wednesday, February 18, 2004 11:21 AM
To: Tom Liu
Cc: gtk-app-devel-list gnome org
Subject: Re: Question about GtkButton->event_window.

Tom Liu wrote:
I check the source code of GtkButton, Looks the GtkButton create a
GdkWindow called event_window. and  GtkButton->event_window coves
the
GtkWidget->window. But When expose event comes, they paint the
button on
the GtkWidget->window. How can the button's images show up?



Why the GtkButton don't use the GtkWidget->window as it's own
GdkWindow?

I cant tell you *exactly* but here's an educated guess:

    (GTK_WIDGET_FLAGS(GTK_WIDGET(button)) & GTK_NO_WINDOW)

is true, so a button will draw to the widget->window (which belongs
to the parent), but since the GdkWindow (and effectivly the X
window) widget->window is bigger than the button, an "event_window"
is used to trap X's "enter-notify"/"leave-notify" in order to
implement prelight states and not execute extra code when the parent
window recieves mouse-overs.


Maykazecents ?

Cheers,
              -Tristan



_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




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