Hi, the NB XLib wrapper covers just the basic functionality. It was made just to prove that it's possible, but not extended much far. If you are using the examples provided, they probably fail when the window is closed because the event loop keeps calling XLib functions, passing the pointer to the window object that has already been destroyed.