RE: Question about GtkButton->event_window.
- From: Owen Taylor <otaylor redhat com>
- To: Tom Liu <tom liu flextrade com>
- Cc: "'Tristan Van Berkom'" <vantr touchtunes com>, gtk-app-devel-list gnome org
- Subject: RE: Question about GtkButton->event_window.
- Date: Thu, 19 Feb 2004 16:28:33 -0500
On Thu, 2004-02-19 at 15:23, Tom Liu wrote:
Check this Gtk+ source code:(gtkbutton.cpp)
static void gtk_button_realize (GtkWidget *widget)
{
[snip]
attributes.event_mask = gtk_widget_get_events (widget);
attributes.event_mask |= (GDK_EXPOSURE_MASK |
GDK_BUTTON_PRESS_MASK |
GDK_BUTTON_RELEASE_MASK |
GDK_ENTER_NOTIFY_MASK |
GDK_LEAVE_NOTIFY_MASK);
[snip]
button->event_window = gdk_window_new (gtk_widget_get_parent_window
(widget),
&attributes, attributes_mask);
gdk_window_set_user_data (button->event_window, button);
[snip]
}
We can see GtkButton->event_window has GDK_EXPOSURE_MASK, means it will
fire the expose event? But I tried to hook the widget->expose_event, and
the GtkButton->event_window didn't send the "expose-event".
This is just a leftover from older versions of GtkButton that worked
differently ... these days GtkButton draws on its parent widget's
window and uses an input-only window to catch mouse events.
So, you might want to file a bug in bugzilla to clean up the code.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]