-command takes a list reference starting with the code reference and then a list of arguments to send to it. Also note that certain widgets always receive their own reference as $_[0] (I think Buttons do this, but other widgets don't), so that the first argument you send might be $_[1].
So it's always a good idea to print what @_ is when you're using this on a new type of widget for the first time to find out where everything is.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.