Cocoa-BatteryInfo

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
    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.
 
    To work those callbacks correctly, you have to use this module with
    Cocoa::EventLoop:
 
        use Cocoa::EventLoop;
        use Cocoa::BatteryInfo;
     
        Cocoa::BatteryInfo::low_battery_handler {
            # do something;
        };
     
        Cocoa::EventLoop->run;

lib/Cocoa/BatteryInfo.pm  view on Meta::CPAN

121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
Register 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 )