Gdk-WARNING gdkdrawable-win32.c 2013 drawable is not a pixmap or window

⌚Time: 2026-05-24 00:28:00

👨‍💻Author: Jack Ge

When I run the GTK program, I found that the console displayed four identical warnings:

Gdk-WARNING **: gdkdrawable-win32.c:2013 drawable is not a pixmap or window

Due to the large amount of code, I used the method of blocking modules to find the cause:

I blocked some main pages and found that the number of warnings decreased. I eventually discovered that two pages were causing these warnings. Moreover, both of these pages have GtkEntry controls.

I commented out the code that adds GtkEntry to the container:

//gtk_box_pack_start(GTK_BOX(hboxd2t),g_filterEntry00,true,true,5);

I found that the warning disappeared, so I confirmed that it was a problem with GtkEntry, but I still don’t know why. I have used this control correctly and added it to the container properly.

If it were only a warning, it would be acceptable, but it started to affect functionality. These pages are added to a GtkNotebook, and after switching pages in the GtkNotebook, the GtkEntry becomes uneditable. It cannot be selected.

And I also found a problem that when GtkTextView outputs log scrolling text, sometimes it can display the text, while other times it doesn't show any output at all.

I used the gtk+-bundle_2.24.10-20120208_win32 version of GTK. I tried changing the GTK version, and when I switched to the gtk+-bundle_2.22.0-20101016_win32 version, there were no warnings or errors. GtkEntry works properly, and GtkTextView can normally output and display content.

GTK2's support for Windows is not perfect. I think gtk-2.24.10 seems to have problems.

Previously, when I was using gtk3, I also encountered a problematic version: gtk+-bundle_3.4.2-20130513_win32. This version would crash when using GtkEntry. In GtkTextView, the text would disappear by itself after switching pages in GtkNotebook. Finally, switching to another version resolved the issue.