ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/perl/option-popup
(Generate patch)

Comparing rxvt-unicode/src/perl/option-popup (file contents):
Revision 1.11 by root, Tue Oct 3 12:13:57 2006 UTC vs.
Revision 1.12 by root, Sun Jun 10 17:31:53 2012 UTC

1#! perl 1#! perl
2
3=head1 NAME
4
5 option-popup - option menu (enabled by default)
6
7=head1 DESCRIPTION
8
9Binds a popup menu to Ctrl-Button2 that lets you toggle (some) options at
10runtime.
11
12Other extensions can extend this popup menu by pushing a code reference
13onto C<@{ $term->{option_popup_hook} }>, which gets called whenever the
14popup is being displayed.
15
16Its sole argument is the popup menu, which can be modified. It should
17either return nothing or a string, the initial boolean value and a code
18reference. The string will be used as button text and the code reference
19will be called when the toggle changes, with the new boolean value as
20first argument.
21
22The following will add an entry C<myoption> that changes
23C<< $self->{myoption} >>:
24
25 push @{ $self->{term}{option_popup_hook} }, sub {
26 ("my option" => $myoption, sub { $self->{myoption} = $_[0] })
27 };
28
29=cut
2 30
3sub on_start { 31sub on_start {
4 my ($self) = @_; 32 my ($self) = @_;
5 33
6 $self->grab_button (2, urxvt::ControlMask); 34 $self->grab_button (2, urxvt::ControlMask);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines