start by copying windtk and dropping dirty rects and indexed colors