Re: gdk events - cunsumes much CPU time
- From: Owen Taylor <otaylor redhat com>
- To: Andreas Volz <andreas brachttal net>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: gdk events - cunsumes much CPU time
- Date: 27 Jun 2003 19:45:30 -0400
Writing a GDK-only app is a not something people do very
often, if ever. A lot of stuff which is easy when using GTK+
gets quite cumbersome when working with GDK only.
But the easiest way to organize a GDK-only app would
be something like:
===
static void
my_event_func (GdkEvent *event,
gpointer data)
{
/* process an event */
}
int main (int argc, char **argv)
{
GMainLoop *loop;
gdk_init (&argv, &argc);
gdk_event_handler_set (my_event_func, NULL, NULL);
/* Create windows, etc. */
loop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (loop);
return 0;
}
===
That's more or less how GTK+ gets events from GDK.
Regards,
Owen
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]