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.9 by root, Thu Feb 2 00:18:51 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
25 override_redirect);
13 26
14 for my $name (sort keys %urxvt::OPTION) { 27 for my $name (sort keys %urxvt::OPTION) {
15 next if $unsafe{$name}; 28 next if $unsafe{$name};
16 29
17 my $optval = $urxvt::OPTION{$name}; 30 my $optval = $urxvt::OPTION{$name};
18 31
19 $popup->add_toggle ($name => sub { $self->option ($optval, $_[0]); warn "toggle $optval, $_[0]" }, 32 $popup->add_toggle ($name => sub { $self->option ($optval, $_[0]) },
20 $self->option ($optval)); 33 $self->option ($optval));
21 } 34 }
22 35
23 $popup->show; 36 $popup->show;
24 37

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines