How to get GtkWindow associed with XID?



Hello.

I need do get the GtkWidget associated with XID. I thought
I can do it using gdk_window_foreign_new, but it doesn't
work for me. I tried many things, after googling I found
something like that:

    GtkWidget *toplevel = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    GdkWindow *gdk_win = gdk_window_foreign_new(xwin);
    gtk_widget_set_parent_window(toplevel, gdk_win);
    gtk_widget_show(toplevel);

But it creates new window and everything paints in that.
It looks like gtk_widget_set_parent_window doesn't work.
What am I doing wrong? Why doesn't it work for me?

Thanks,
    Jack



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