You are indeed.
The script handler gets passed a parameter (self) (the widget) and you then pass it on to your function by declaring function(self)... end for the script to call.
The "self" in the function declaration is more convention, it could be anything
Code:
function(frame) print(frame:GetName()) end
Code:
function(myWidget) print(myWidget:GetName()) end