*** empty log message ***
authorroot <root>
Sun, 8 Jan 2006 00:27:47 +0000 (00:27 +0000)
committerroot <root>
Sun, 8 Jan 2006 00:27:47 +0000 (00:27 +0000)
src/perl/option-popup [new file with mode: 0644]
src/perl/urxvt-popup

diff --git a/src/perl/option-popup b/src/perl/option-popup
new file mode 100644 (file)
index 0000000..d516602
--- /dev/null
@@ -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;
+   }
+
+   ()
+}
+
index 5f7bde9a0282a554f5fc5ab61fe00ac2223c46fe..259544760298b0226509b86436787c5761b564f2 100644 (file)
@@ -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