… | |
… | |
154 | </dt> |
154 | </dt> |
155 | <dd> |
155 | <dd> |
156 | Binds a popup menu to Ctrl-Button2 that lets you toggle (some) options at |
156 | Binds a popup menu to Ctrl-Button2 that lets you toggle (some) options at |
157 | runtime. |
157 | runtime. |
158 | </dd> |
158 | </dd> |
|
|
159 | <dd> |
|
|
160 | <p>Other extensions can extend this popup menu by pushing a code reference |
|
|
161 | onto <code>@{ $term-</code>{option_popup_hook} }>, which gets called whenever the |
|
|
162 | popup is being displayed.</p> |
|
|
163 | </dd> |
|
|
164 | <dd> |
|
|
165 | <p>It's sole argument is the popup menu, which can be modified. It should |
|
|
166 | either return nothing or a string, the initial boolean value and a code |
|
|
167 | reference. The string will be used as button text and the code reference |
|
|
168 | will be called when the toggle changes, with the new boolean value as |
|
|
169 | first argument.</p> |
|
|
170 | </dd> |
|
|
171 | <dd> |
|
|
172 | <p>The following will add an entry <code>myoption</code> that changes |
|
|
173 | <code>$self-</code>{myoption}>:</p> |
|
|
174 | </dd> |
|
|
175 | <dd> |
|
|
176 | <pre> |
|
|
177 | push @{ $self->{term}{option_popup_hook} }, sub { |
|
|
178 | ("my option" => $myoption, sub { $self->{myoption} = $_[0] }) |
|
|
179 | };</pre> |
|
|
180 | </dd> |
159 | <p></p> |
181 | <p></p> |
160 | <dt><strong>selection-popup (enabled by default)</strong><br /> |
182 | <dt><strong>selection-popup (enabled by default)</strong><br /> |
161 | </dt> |
183 | </dt> |
162 | <dd> |
184 | <dd> |
163 | Binds a popup menu to Ctrl-Button3 that lets you convert the selection |
185 | Binds a popup menu to Ctrl-Button3 that lets you convert the selection |
164 | text into various other formats/action (such as uri unescaping, perl |
186 | text into various other formats/action (such as uri unescaping, perl |
165 | evaluation, web-browser starting etc.), depending on content. |
187 | evaluation, web-browser starting etc.), depending on content. |
166 | </dd> |
188 | </dd> |
167 | <dd> |
189 | <dd> |
168 | <p>Other extensions can extend this popup menu by pushing a code reference |
190 | <p>Other extensions can extend this popup menu by pushing a code reference |
169 | onto <code>@{ $term-</code>{selection_popup_hook} }>, that is called whenever the |
191 | onto <code>@{ $term-</code>{selection_popup_hook} }>, which gets called whenever the |
170 | popup is displayed.</p> |
192 | popup is being displayed.</p> |
171 | </dd> |
193 | </dd> |
172 | <dd> |
194 | <dd> |
173 | <p>It's sole argument is the popup menu, which can be modified. The selection |
195 | <p>It's sole argument is the popup menu, which can be modified. The selection |
174 | is in <code>$_</code>, which can be used to decide wether to add something or not. |
196 | is in <code>$_</code>, which can be used to decide wether to add something or not. |
175 | It should either return nothing or a string and a code reference. The |
197 | It should either return nothing or a string and a code reference. The |
… | |
… | |
1639 | <dd> |
1661 | <dd> |
1640 | Adds a clickable button to the popup. <code>$cb</code> is called whenever it is |
1662 | Adds a clickable button to the popup. <code>$cb</code> is called whenever it is |
1641 | selected. |
1663 | selected. |
1642 | </dd> |
1664 | </dd> |
1643 | <p></p> |
1665 | <p></p> |
1644 | <dt><strong><a name="item_add_toggle">$popup->add_toggle ($text, $cb, $initial_value)</a></strong><br /> |
1666 | <dt><strong><a name="item_add_toggle">$popup->add_toggle ($text, $initial_value, $cb)</a></strong><br /> |
1645 | </dt> |
1667 | </dt> |
1646 | <dd> |
1668 | <dd> |
1647 | Adds a toggle/checkbox item to the popup. Teh callback gets called |
1669 | Adds a toggle/checkbox item to the popup. The callback gets called |
1648 | whenever it gets toggled, with a boolean indicating its value as its first |
1670 | whenever it gets toggled, with a boolean indicating its new value as its |
1649 | argument. |
1671 | first argument. |
1650 | </dd> |
1672 | </dd> |
1651 | <p></p> |
1673 | <p></p> |
1652 | <dt><strong>$popup->show</strong><br /> |
1674 | <dt><strong>$popup->show</strong><br /> |
1653 | </dt> |
1675 | </dt> |
1654 | <dd> |
1676 | <dd> |