ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/option-popup
Revision: 1.9
Committed: Thu Feb 2 00:18:51 2006 UTC (18 years, 3 months ago) by root
Branch: MAIN
Changes since 1.8: +2 -1 lines
Log Message:
*** empty log message ***

File Contents

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