gtk_main_do_event() doesn't work as described ?
- From: "Sergey I. Kuzminov" <ksi sparc spb su>
- To: gtk-list gnome org
- Subject: gtk_main_do_event() doesn't work as described ?
- Date: Fri, 14 Dec 2001 16:34:14 +0300
> Hi,
> I've got one problem with gtk_main_do_event() method.
> I want to send and receive events using gtk_main_do_event() and
> gtk_get_current_event().
>
> Documentation for gtk_main_do_event() says:
> ...
> 3.Then the event is passed on a stack so you can query the currently handled
> event with gtk_get_current_event().
> ...
>
> Why I can't receive events with gtk_get_current_event(),
> but receive events using gdk_event_put() and gdk_event_get() ?
> (see commented strings)
>
> What's the difference between these methods?
>
> Thanks,
> Sergey
>
> -----------------
> Test case:
>
> #include <gtk/gtk.h>
>
> int
> main (int argc, char** argv)
> {
> GtkWidget* widget;
> GdkEvent* event;
> GdkEventAny e;
>
> gtk_init (&argc, &argv);
>
> widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_widget_show (widget);
>
> e.type = GDK_DESTROY;
> e.window = widget->window;
>
> gtk_main_do_event ((GdkEvent*)&e);
> // gdk_event_put ((GdkEvent*)&e);
>
> event = gtk_get_current_event ();
> // event = gdk_event_get ();
>
> printf ("\n%p\n", event);
> }
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]