Re: [gtk-list] Expose events and drawing areas
- From: Owen Taylor <owt1 cornell edu>
- To: gtk-list redhat com
- Cc: Per Lewau <perle lysator liu se>
- Subject: Re: [gtk-list] Expose events and drawing areas
- Date: Mon, 27 Oct 1997 16:28:10 -0500
> gtk_signal_connect(GTK_OBJECT(drawing_area), "expose_event",
> GTK_SIGNAL_FUNC(expose_handler), NULL);
> gtk_signal_connect(GTK_OBJECT(drawing_area), "configure_event",
> GTK_SIGNAL_FUNC(configure_handler), NULL);
gtk_widget_set_events (drawing_area, GTK_EXPOSURE_MASK);
>
> gtk_container_add(GTK_CONTAINER(main_window), drawing_area);
Hope this helps,
Owen
(Configure events are sort of special - gdk automatically adds
GDK_STRUCTURE_MASK to the event mask so it can keep track of
window size.
Aargh. Just thought of a bug in gdk_window_set_events. Not that
it affects much - it isn't used by gtk_widget_set_events.)
Index: gdkwindow.c
===================================================================
RCS file: /home/cvs/gtk+/gdk/gdkwindow.c,v
retrieving revision 1.5
diff -c -r1.5 gdkwindow.c
*** gdkwindow.c 1997/10/17 06:06:47 1.5
--- gdkwindow.c 1997/10/27 21:23:48
***************
*** 1098,1104 ****
long xevent_mask;
int i;
! xevent_mask = 0;
for (i = 0; i < nevent_masks; i++)
{
if (event_mask & (1 << (i + 1)))
--- 1098,1104 ----
long xevent_mask;
int i;
! xevent_mask = StructureNotifyMask;
for (i = 0; i < nevent_masks; i++)
{
if (event_mask & (1 << (i + 1)))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]