Cocoa-BatteryInfo
view release on metacpan or search on metacpan
949596979899100101102103104105106107108109110111112113114
Register low battery event handler called
when
the battery
time
remaining drops into a warnable level.
time_remaining_handler(
$callback
:CodeRef)
Register
time
remaining event handler called
when
the power source(s)
time
remaining changes.
NOTICE
Callbacks listed above
do
nothing without under the Cocoa's event loop.
Cocoa::EventLoop:
Cocoa::BatteryInfo::low_battery_handler {
# do something;
};
Cocoa::EventLoop->run;
lib/Cocoa/BatteryInfo.pm view on Meta::CPAN
121122123124125126127128129130131132133134135136137138139140Register low battery event handler called
when
the battery
time
remaining drops into a warnable level.
=head2 time_remaining_handler($callback :CodeRef)
Register time remaining event handler called when the power source(s) time remaining changes.
=head1 NOTICE
Callbacks listed above do nothing without under the Cocoa's event loop.
To work those callbacks correctly, you have to use this module with L<Cocoa::EventLoop>:
use Cocoa::EventLoop;
use Cocoa::BatteryInfo;
Cocoa::BatteryInfo::low_battery_handler {
# do something;
};
Cocoa::EventLoop->run;
( run in 0.233 second using v1.01-cache-2.11-cpan-05444aca049 )