How can i retrieve Window ID of gtk window

♀尐吖头ヾ 提交于 2021-02-07 22:40:33

问题


I am having an application where i need to display streaming video using XV.

I will pass top-level window ID to underlying video playing application which will Attach/Add child window (child window with streaming videos in it) to my window. So for that I need to get ID of top level window provided by operating system.

I am using GTK+ and C on Linux.


回答1:


You use the GDK_DRAWABLE_XID() macro, assuming you're on X11:

GtkWindow *mywindow;
GdkWindow *gwin;

gwin = gtk_widget_get_window(GTK_WIDGET(mywindow));
printf("the X11 id is %u\n", GDK_DRAWABLE_XID(gwin));


来源:https://stackoverflow.com/questions/1879326/how-can-i-retrieve-window-id-of-gtk-window

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!