Make it work within GUI apps