Re: events_pending



Tue, 20 Oct 1998, Pauli Virtanen wrote:
>
> How can I do this in gtk+.

Connect to key_press_event and button_press_event and whatever else you
care about, and have your callbacks do the right thing. Or connect to
plain event, and then do:

switch (event->type) {
case GDK_BUTTON_PRESS:

break;
/* etc */
}

in your callback.

Havoc

Thanx for the reply.
I use 'entry' in the gtk+ as a message window and I use it in two
separate ways:
[snip]
Yes, I can get signals, that's easy, but that wating loop
I can't figure out.

pauli

Hah, it was that easy:

XWarpPointer(dpy, None, window, 0, 0, 0, 0, len, heig/2);
for (;;)  {
  while (gdk_events_pending())  {
    ev = gdk_event_get();
    if (ev->type == GDK_KEY_PRESS)
      message_event(messages, ev);
  }
}

pauli



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