| 1 | # You may distribute under the terms of the GNU General Public License | ||||||||||
| 2 | # | ||||||||||
| 3 | # (C) Paul Evans, 2008-2014 -- leonerd@leonerd.org.uk | ||||||||||
| 4 | |||||||||||
| 5 | package Circle::Widget::Scroller; | ||||||||||
| 6 | |||||||||||
| 7 | 4 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 4 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 4 | ▶ | use base qw( Circle::Widget ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 4 | our $VERSION = '0.173320'; | |||||||||
| 12 | |||||||||||
| 13 | sub new | ||||||||||
| 14 | 4 | ▶ | { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 15 | 4 | my $class = shift; | |||||||||
| 16 | 4 | my %args = @_; | |||||||||
| 17 | |||||||||||
| 18 | 4 | my $self = $class->SUPER::new( @_ ); | |||||||||
| 19 | |||||||||||
| 20 | 4 | $self->{scrollback} = $args{scrollback}; | |||||||||
| 21 | |||||||||||
| 22 | 4 | return $self; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | sub push_event | ||||||||||
| 26 | 8 | ▶ | { | ||||||||
|
Subroutine
push_event: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 27 | 8 | my $self = shift; | |||||||||
| 28 | 8 | my ( $event, $time, $args ) = @_; | |||||||||
| 29 | |||||||||||
| 30 | 8 | my $eventqueue = $self->get_prop_displayevents; | |||||||||
| 31 | |||||||||||
| 32 | 8 | my $overcount = @$eventqueue + 1 - $self->{scrollback}; | |||||||||
| 33 | |||||||||||
| 34 | 8 | ▶ | $self->shift_prop_displayevents( $overcount ) if $overcount > 0; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 35 | |||||||||||
| 36 | 8 | $self->push_prop_displayevents( [ $event, $time, $args ] ); | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 4 | 0x55AA; | |||||||||