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.8 by root, Fri Jan 20 10:27:08 2006 UTC

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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines