Changeset 68
- Timestamp:
- 05/06/08 15:49:23 (8 months ago)
- Files:
-
- 1 modified
-
trunk/Curses-UI-POE/examples/irc_client (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Curses-UI-POE/examples/irc_client
r67 r68 135 135 use Curses; 136 136 use Carp qw( carp ); 137 use constant KEY_TAB => "\t"; 137 138 138 139 my @nicks; … … 283 284 ); 284 285 286 my $set_editor_focus = sub { 287 $editor->focus; 288 $editor->draw; 289 }; 290 291 $nicks->onFocus($set_editor_focus); 292 $viewer->onFocus($set_editor_focus); 293 $menu->onFocus($set_editor_focus); 285 294 286 295 my (%Channel, $Current, @History); … … 321 330 322 331 nick => sub { $poe_kernel->post( IRC => nick => $_[1] ) }, 323 kick => sub { $poe_kernel->post( IRC => kick => $_[1..$#_] ) },324 msg => sub { $poe_kernel->post( IRC => privmsg => $_[1..$#_] ) },332 kick => sub { $poe_kernel->post( IRC => kick => @_[1..$#_] ) }, 333 msg => sub { $poe_kernel->post( IRC => privmsg => @_[1..$#_] ) }, 325 334 326 335 quote => sub { … … 364 373 } 365 374 }, KEY_ENTER; 375 376 set_binding $editor sub { 377 # Do nothing...overload the lose-focus event. 378 }, KEY_TAB, KEY_BTAB; 379 380 # Why doesn't this work? 381 set_binding $editor sub { 382 warn "Calling \$viewer->cursor_pageup"; 383 $viewer->cursor_pageup; 384 $viewer->draw; 385 }, KEY_PPAGE; 386 387 set_binding $editor sub { 388 warn "Calling \$viewer->cursor_pagedown"; 389 $viewer->cursor_pagedown; 390 $viewer->draw; 391 }, KEY_NPAGE; 366 392 367 393 set_binding $editor sub { shift->text($History[--$Current]) }, KEY_UP; … … 371 397 else { shift->text( $History[$Current] ) } 372 398 }, KEY_DOWN; 399 400 # Focus on the editor. 401 $editor->focus; 402 $editor->draw; 373 403 374 404 $_[-1] = bless {