Skip to content

Commit

Permalink
fix scrolling of console widget
Browse files Browse the repository at this point in the history
  • Loading branch information
grantm committed Nov 29, 2009
1 parent b081da1 commit 360e01c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
- fix scrolling
- implement Edit > Preferences
- enable/disable sounds
- select a sound file (+ test button)
Expand Down
9 changes: 7 additions & 2 deletions lib/App/USBKeyCopyCon.pm
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,13 @@ sub build_console {
$console->set_cursor_visible(FALSE);
$console->set_wrap_mode('char');

my $end_mark = $buffer->create_mark( 'end', $buffer->get_end_iter, FALSE);
$buffer->signal_connect(
insert_text => sub {
$console->scroll_to_mark( $end_mark, 0.0, TRUE, 0.0, 0.0 );
}
);

$self->console($console);

$scrolled_window->add($console);
Expand All @@ -810,8 +817,6 @@ sub say {
my $buffer = $console->get_buffer;
my $end = $buffer->get_end_iter;
$buffer->insert ($end, $msg);
$end = $buffer->get_end_iter;
$console->scroll_to_iter($end, 0, 0, 0, 0);
}


Expand Down

0 comments on commit 360e01c

Please sign in to comment.