Use the setvariable widget instead of macrodef

setvariable is more general