--- rxvt-unicode/src/urxvt.pm 2006/01/07 20:23:52 1.45 +++ rxvt-unicode/src/urxvt.pm 2006/01/07 21:43:17 1.48 @@ -333,6 +333,14 @@ Returns the "current time" (as per the event loop). +=item urxvt::CurrentTime + +=item urxvt::ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, +Mod3Mask, Mod4Mask, Mod5Mask, Button1Mask, Button2Mask, Button3Mask, +Button4Mask, Button5Mask, AnyModifier + +Various constants for use in X events. + =back =head2 RENDITION @@ -391,8 +399,10 @@ package urxvt; +use utf8; use strict; use Scalar::Util (); +use List::Util (); our $TERM; our @HOOKNAME; @@ -778,6 +788,15 @@ Return various integers describing terminal characteristics. +=item $modifiermask = $term->ModLevel3Mask + +=item $modifiermask = $term->ModMetaMask + +=item $modifiermask = $term->ModNumLockMask + +Return the modifier masks corresponding to the "ISO Level 3 Shift" (often +AltGr), the meta key (often Alt) and the num lock key, if applicable. + =item $view_start = $term->view_start ([$newvalue]) Returns the negative row number of the topmost line. Minimum value is @@ -985,7 +1004,18 @@ sub add_button { my ($self, $text, $cb) = @_; - $self->add_item ({ type => "button", text => "[ $text ]", activate => $cb }); + $self->add_item ({ type => "button", text => "[ $text ]", activate => $cb, + render => sub { $_[0]{text} }, + }); +} + +sub add_toggle { + my ($self, $text, $cb, $value) = @_; + + $self->add_item ({ type => "button", text => " $text", value => $value, + render => sub { ($_[0]{value} ? "✔" : " ") . substr $_[0]{text}, 1 }, + activate => sub { $cb->($_[0]{value} = !$_[0]{value}); }, + }); } sub show { @@ -995,7 +1025,7 @@ urxvt->new ("--perl-lib" => "", "--perl-ext-common" => "", "-pty-fd" => -1, "-sl" => 0, "-b" => 0, "--transient-for" => $self->{term}->parent, - "-pe" => "urxvt_popup") + "-pe" => "urxvt-popup") or die "unable to create popup window\n"; }