ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/option-popup
Revision: 1.7
Committed: Mon Jan 9 00:34:36 2006 UTC (18 years, 4 months ago) by root
Branch: MAIN
CVS Tags: rel-7_1, rel-7_0
Changes since 1.6: +3 -3 lines
Log Message:
*** empty log message ***

File Contents

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