method as trigger
[email protected] (Ch Lamprecht)
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <[email protected]> |
Hello,
I was trying to use a method of my class as 'trigger' in an attributes
definition. Here is what I wrote:
has pub_in_a_TkObjectsModel_Instance => ( isa => 'TkObjectsModel',
is => 'rw',
trigger => sub{$_[0] -> changed($_[2])},
);
That works fine. However, are there more elegant solutions? Wouldn't it be a
nice feature, if we could say:
...
trigger => 'changed',
...
(Like in a Perl-Tk callback definition)?
Christoph