Printing gadgets to file