1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <gdk/gdkx.h>
#include <gtk/gtk.h>
#include <glade/glade.h>
int main (int argc,
char *argv[])
{
GtkWidget *window, *courbes_1;
GladeXML *xml;
static Window gxDrawable, gxRootWindow;
static Display *gxDisplay;
static GC gxGC, gxRootGC;
static XWindowAttributes gxRootAttr;
gtk_init (&argc, &argv);
xml = glade_xml_new ("browser.glade", NULL, NULL);
window = glade_xml_get_widget (xml, "window");
courbes_1 = glade_xml_get_widget (xml, "courbes_1");
/* Début mappage GTK - X11 */
gxGC = GDK_GC_XGC(courbes_1->style->fg_gc[GTK_WIDGET_STATE(courbes_1)]);
gxDrawable = GDK_WINDOW_XWINDOW(courbes_1->window),
gxDisplay = GDK_GC_XDISPLAY(courbes_1->style->fg_gc[GTK_WIDGET_STATE(courbes_1)]);
gxRootWindow = GDK_ROOT_WINDOW();
XGetWindowAttributes(gxDisplay, gxRootWindow, &gxRootAttr);
gxRootGC = XCreateGC(gxDisplay, gxDrawable, 0, NULL);
/* Fin mappage GTK - X11 */
glade_xml_signal_autoconnect (xml);
gtk_widget_show_all (window);
gtk_main ();
return 0;
} |
Partager