From e634385619b2789e169e45372d60e8218e6e1d89 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 8 Jan 2006 00:27:47 +0000 Subject: [PATCH] *** empty log message *** --- src/perl/option-popup | 30 ++++++++++++++++++++++++++++++ src/perl/urxvt-popup | 13 ++++--------- 2 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 src/perl/option-popup diff --git a/src/perl/option-popup b/src/perl/option-popup new file mode 100644 index 00000000..d5166027 --- /dev/null +++ b/src/perl/option-popup @@ -0,0 +1,30 @@ +#! perl + +sub on_button_press { + my ($self, $event) = @_; + + if ($event->{button} == 3 && $event->{state} & urxvt::ControlMask) { + my $popup = $self->popup ($event); + + my %unsafe = map +($_ => 1), + qw(borderLess console iconic loginShell reverseVideo + scrollBar scrollBar_floating scrollBar_right + secondaryScreen transparent utmpInhibit); + + for my $name (sort keys %urxvt::OPTION) { + next if $unsafe{$name}; + + my $optval = $urxvt::OPTION{$name}; + + $popup->add_toggle ($name => sub { $self->option ($optval, $_[0]); warn "toggle $optval, $_[0]" }, + $self->option ($optval)); + } + + $popup->show; + + return 1; + } + + () +} + diff --git a/src/perl/urxvt-popup b/src/perl/urxvt-popup index 5f7bde9a..25954476 100644 --- a/src/perl/urxvt-popup +++ b/src/perl/urxvt-popup @@ -57,16 +57,11 @@ sub on_button_release { $self->{press}[$event->{button}] = 0; - if ($event->{button} == 1) { - refresh $self; - - warn "$event->{row} $event->{col}\n";#d# + refresh $self; - if ($col >= 0 && $col < $self->ncol - && $row >= 0 && $row < @{ $self->{data}{item} }) { - $self->{data}{item}[$row]{activate}->($event); - print "ok\n"; - } + if ($col >= 0 && $col < $self->ncol + && $row >= 0 && $row < @{ $self->{data}{item} }) { + $self->{data}{item}[$row]{activate}->($event); } 1 -- 2.34.1