ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/option-popup
Revision: 1.5
Committed: Sun Jan 8 01:16:10 2006 UTC (18 years, 4 months ago) by root
Branch: MAIN
Changes since 1.4: +3 -0 lines
Log Message:
*** empty log message ***

File Contents

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