Fix widget information passing

Also add a check box to specify whether or not to output result to a file.