Widget code generator