Re: Can I mix Xlib and Gtk+ in one app?
- From: John Cupitt ng-london org uk
- To: sandyfox sina com
- Cc: i krabbe dokom net, gtk-list gnome org
- Subject: Re: Can I mix Xlib and Gtk+ in one app?
- Date: Wed, 19 Dec 2001 11:42:50 -0000
>>>> I'm writing an app using xlib, but I need some buttons and menus.
I've done this a little. It's dangerous, unsupported and will probably
break if gtk/gdk changes much, but it does sort-of work.
- to keep gtk happy, you must do this several times a second:
while( g_main_iteration( FALSE ) )
;
this will fetch and process all outstanding events, including
timeout, asynch reads from files, socket stuff, etc.
- before you start doing Xlib stuff, do a gdk_flush() to clear
gtk's output buffer
- get gtk's Display with
#include <gdk/gdkprivate.h>
#include <gdk/gdkx.h>
Display *my_display = gdk_display;
- do some XLib stuff, but make sure you only read events which
you triggered ... put all other events back in the queue
- do an XFlush(), and hand control back to gtk
As Paul said though, you should not use Xlib. Use gtk/gdk instead, it's
much better.
John
==========================================================
Renaissance Autumn at the National Gallery
A season of exhibitions, displays and events with a Renaissance theme.
Pisanello: Painter to the Renaissance Court (24 October - 13 January 2002)
For information and tickets:
http://www.nationalgallery.org.uk/what/news/ren_autumn.htm
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]