Dynamic method for creating the menuVar