简体   繁体   English

如何在 Gtkmm4 中获取 Gtk::Window 的 XId

[英]How to get the XId of a Gtk::Window in Gtkmm4

I am using Gtkmm4, and lots of API has been removed.我正在使用 Gtkmm4,并且很多 API 已被删除。 In Gtk3 one could use Gtk::Window::get_xid (inherited from Gdk::Window ), but thats not possible anymore, because Gdk::Window has been renamed to Gdk::Surface , and Gtk::Window seems to not inherit from it anymore. In Gtk3 one could use Gtk::Window::get_xid (inherited from Gdk::Window ), but thats not possible anymore, because Gdk::Window has been renamed to Gdk::Surface , and Gtk::Window seems to not inherit从此不再。 But, one can always get the XId of a Gdk::Surface using GDK_SURFACE_XID(surface) .但是,总是可以使用GDK_SURFACE_XID(surface)获得Gdk::Surface的 XId。 How can i get the Gdk::Surface of a Gtk::Window , or alternatively, get the XId from a Gtk::Window directly? How can i get the Gdk::Surface of a Gtk::Window , or alternatively, get the XId from a Gtk::Window directly?
Note: i need only solutions using Gtkmm 4, not Gtkmm 3 !注意:我只需要使用 Gtkmm 4 的解决方案,而不是 Gtkmm 3 !

The code that deals with the underlying surfaces got split off into a separate interface, Gtk::Native , which Gtk::Window then implements.处理底层表面的代码被拆分到一个单独的接口Gtk::Native ,然后Gtk::Window实现。 Gtk::Native has a method get_surface() which should just work like Gtk::Window::get_window() did in GTK 3. Gtk::Native has a method get_surface() which should just work like Gtk::Window::get_window() did in GTK 3.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM