No, not your fault. The code works on Windows, but not on Linux, neither on gtk2 nor on qt5, also not on macOS/cocoa. But even on Windows you will not be very happy because you'd have to repaint everything yourself then: the caption, the gutter, the icons, checkmarks