ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/option-popup
(Generate patch)

Comparing rxvt-unicode/src/perl/option-popup (file contents):
Revision 1.1 by root, Sun Jan 8 00:27:47 2006 UTC vs.
Revision 1.4 by root, Sun Jan 8 00:48:14 2006 UTC

1#! perl 1#! perl
2
3sub on_start {
4 my ($self) = @_;
5
6 $self->grab_button (3, urxvt::ControlMask);
7}
2 8
3sub on_button_press { 9sub on_button_press {
4 my ($self, $event) = @_; 10 my ($self, $event) = @_;
5 11
6 if ($event->{button} == 3 && $event->{state} & urxvt::ControlMask) { 12 if ($event->{button} == 3 && $event->{state} & urxvt::ControlMask) {
7 my $popup = $self->popup ($event); 13 my $popup = $self->popup ($event);
8 14
9 my %unsafe = map +($_ => 1), 15 my %unsafe = map +($_ => 1),
10 qw(borderLess console iconic loginShell reverseVideo 16 qw(borderLess console iconic loginShell reverseVideo
11 scrollBar scrollBar_floating scrollBar_right 17 scrollBar scrollBar_floating scrollBar_right
12 secondaryScreen transparent utmpInhibit); 18 secondaryScreen transparent utmpInhibit meta8);
13 19
14 for my $name (sort keys %urxvt::OPTION) { 20 for my $name (sort keys %urxvt::OPTION) {
15 next if $unsafe{$name}; 21 next if $unsafe{$name};
16 22
17 my $optval = $urxvt::OPTION{$name}; 23 my $optval = $urxvt::OPTION{$name};
18 24
19 $popup->add_toggle ($name => sub { $self->option ($optval, $_[0]); warn "toggle $optval, $_[0]" }, 25 $popup->add_toggle ($name => sub { $self->option ($optval, $_[0]) },
20 $self->option ($optval)); 26 $self->option ($optval));
21 } 27 }
22 28
23 $popup->show; 29 $popup->show;
24 30

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines