Move setVar and getVar outside of Widget class.