Paulo Flabiano Smorigo wrote:
Hi everyone,I'm trying to use the get_window() function to get the window id of my gtkmm app but the function returns null.This is the function that I'm using: int wid; Glib::RefPtr<Gdk::Window> wid = get_window(); wid = GDK_WINDOW_XID(Glib::unwrap(get_window())); std::cout << "WID: " << wid << std::endl; So, what's wrong?
You need to make sure your widget is realized (showing on screen) first. See for example following threads:
http://marc.info/?l=gtkmm&m=120640734302938&w=2 http://marc.info/?l=gtkmm&m=120641965018848&w=2 http://marc.info/?l=gtkmm&m=120119160717684&w=2 -- José Alburquerque