Re: Please help: How to embed a X window in a GTK window?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bin Chen wrote:
On 3/2/08, Ke Jin <jinkea gmail com> wrote:
Dear All,
I am working on a project whose code was written in Xlib and now I
need to develop a GUI for it. I want to use GTK so I wonder if I could
embed the former xlib window into a GTK top-level window. I wrote a
small test program as below but it doesn't work. Does anyone have any
idea about how this is gonna work?

Look into GtkPlug or something like this... where windowid is the Xid of
a window. And window is a gtk_window object

    if (windowid != 0) {

        window_container = gdk_window_foreign_new(windowid);
        if (GTK_WIDGET_MAPPED(window))
            gtk_widget_unmap(window);

        gdk_window_reparent(window->window, window_container, 0, 0);

    }

Kevin


- --
Get my public GnuPG key from
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x7D0BD5D1
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkfKrZ0ACgkQ6w2kMH0L1dE+9QCfYB2HBMX3fWww08uxSMApon1y
kSYAnjqO2yHjDFrC/s94dfNSm/3aRfbO
=GZm/
-----END PGP SIGNATURE-----



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