Re: sending events to desktop



>#include <gtk/gtk.h>
>
>int
>main (int argc, char **argv)
>{
>  GdkEvent *event;
>
>  event->button.type = GDK_BUTTON_PRESS;
>  event->button.x_root = 100;
>  event->button.y_root = 100;
>  event->button.source = GDK_SOURCE_MOUSE;
>  event->button.button = 3;
>
>  gtk_main_do_event(event);
>
>  exit(1);
>}

not that i'm sure the above code will work anyway, but just for
starters, you can't use GTK without a call to gtk_init(). even then, i
suspect this is not going to do what you want. gtk_main_do_event() is
"application-local". it does not send events to other instances of the
X event loop (i.e. other processes). there are ways to do this, but i
don't know how to with GTK itself.

--p




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