#include #include "kstextview.h" class Timer : public TQObject { public: Timer( KSirc::TextView *view ) : m_view( view ), m_lines( 0 ) { //startTimer( 5000 ); } void timerEvent( TQTimerEvent * ) { m_lines++; if ( m_lines > 15 ) m_view->removeParag( m_view->firstParag() ); m_view->appendParag( TQString::fromLatin1( "color testcolor testcolor testcolor testcolor testcolor testcolor testcolor testcolor test" ) ); m_view->appendParag( TQString::fromLatin1( "aaaaaa bbbbbb cccccccc ddddddddd eeeeeee " ) ); m_view->setContentsPos( 0, m_view->contentsHeight() ); } private: KSirc::TextView *m_view; int m_lines; }; int main( int argc, char **argv ) { TDEApplication app( argc, argv, "kstextviewtest" ); KSirc::TextView view( 0 ); app.setMainWidget( &view ); view.show(); view.appendParag( TQString::fromLatin1( "boldNormalItalic hey!reverse!" ) ); view.appendParag( TQString::fromLatin1( "bleh foo hey bar schubidu bliep blop" ) ); view.appendParag( TQString::fromLatin1( "more longish paragraphs .. yaddayadda yadda" ) ); view.appendParag( TQString::fromLatin1( "<tronical> hah! &" ) ); view.appendParag( TQString::fromLatin1( "url" ) ); view.appendParag( TQString::fromLatin1( "color test" ) ); view.appendParag( TQString::fromLatin1( "another color test" ) ); view.appendParag( TQString::fromLatin1( "another color test" ) ); view.appendParag( TQString::fromLatin1( "simple attr test 123 \" oof>complicated attr test" ) ); view.appendParag( TQString::fromLatin1( "\" 123 \" oof>\"third attr test 2\"" ) ); view.appendParag( TQString::fromLatin1( "aaaaaa bbbbbb cccccccc ddddddddd eeeeeee" ) ); Timer t( &view ); return app.exec(); }