22 Aug 2013 00:04:22 UTC
- Distribution: Gtk2-Ex-ErrorTextDialog
- Module version: 11
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (0)
- Testers (1005 / 6 / 0)
- KwaliteeBus factor: 1
- 88.24% Coverage
- License: open_source
- Perl: v5.8.1
- Activity24 month
- Download (71.54KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionKRYDE Kevin Rydeand 1 contributors
- Kevin Ryde
Gtk2::Ex::TextView::FollowAppend -- variant of TextView following appended text
use Gtk2::Ex::TextView::FollowAppend; my $textview = Gtk2::Ex::TextView::FollowAppend->new;
Gtk2::Ex::TextView::FollowAppendis a subclass of
Gtk2::Widget Gtk2::Container Gtk2::TextView Gtk2::Ex::TextView::FollowAppend
This is slightly experimental and might move to a different dist.
TextView::FollowAppend arranges to automatically scroll to follow text appended in the underlying TextBuffer. The effect is like Emacs
compilation-scroll-outputand is good for following text progressively added by a background task or subprocess, but still allowing the user to scroll back to see earlier output.
A scroll is done when the insertion point cursor is at the end of the buffer and the buffer end is visible. Any text, pixbuf or child insertion, or child resize or window resize then gets a scroll to keep the end still visible.
This is implemented as a subclass of TextView since that seems the easiest way to catch a
size-allocatebefore the new size has been applied, so as to see whether the cursor-at-end plus end-visible conditions are met and thus end-visible should be forced on the new size. Because
run-firstsignal an external signal connection only runs once the new size is applied. Maybe it'd be possible to track end-visible all the time though, ready for a window resize or contents resize.
$textview = Gtk2::Ex::TextView::FollowAppend->new (key=>value,...)
Create and return a new TextView::FollowAppend object. Optional key/value pairs set initial properties as per
$textview = Gtk2::Ex::TextView::FollowAppend->new;
$textview = Gtk2::Ex::TextView::FollowAppend->new_with_buffer ($textbuf)
Create and return a new TextView::FollowAppend with an initial TextBuffer. This is as per
Gtk2::TextView->new_with_buffer, but creating a TextView::FollowAppend. It's the same as
$textview = Gtk2::Ex::TextView::FollowAppend->new (buffer => $textbuf);
Gtk2-Ex-ErrorTextDialog is Copyright 2007, 2008, 2009, 2010, 2011, 2013 Kevin Ryde
Gtk2-Ex-ErrorTextDialog is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Gtk2-Ex-ErrorTextDialog is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Gtk2-Ex-ErrorTextDialog. If not, see http://www.gnu.org/licenses/.
Module Install Instructions
To install Gtk2::Ex::ErrorTextDialog, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Gtk2::Ex::ErrorTextDialog
For more information on module installation, please visit the detailed CPAN module installation guide.