Re: visibility_notify_event

Federico Mena Quintero <federico helixcode com> writes:

> Aaron Kennedy <aaron icr com au> writes:
> > I am having a problem getting a GtkWindow to emit the event
> > visibility_notify_event.  In the Gtk Documentation, I see that this event
> > is emitted for a GtkWidget, but not it's "derived" widget GtkWindow.  Is
> > there a way to get GtkWindow to emit this also?  An example is given
> > below, where the function "function()" is never called...
> > 
> > GtkWidget *window;
> > window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> > gtk_signal_connect(GTK_OBJECT(window), "visibility_notify_event",
> >                    GTK_SIGNAL_FUNC(function), NULL);
> Try
> gtk_widget_add_events (window, 
> 		       (gtk_wiget_get_events (window)

Uhh, that's why it is called add_events(), because it adds
to the existing event mask.... 

 gtk_widget_add_events (window, GDK_VISIBILITY_NOTIFY_MASK));

Is completely equivalent.


[ gtk_widget_set_events() is the more common function that that just
  sets the event mask. The main limitation of it is that it has to be
  called before the window is initially shown, so this is why
  gtk_widget_add_events() was added. It wasn't possible to reliably
  _set_ the event mask after the window was shown, but augmenting it
  is possible. ]

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