Re: Displaying console output
On Apr 21, 2008, at 8:12 PM, Thomas Rosario wrote: Hi All, I'm trying to build a GUI to show console output of an existing application. What I've done is 'clicked' signal_connect from Gtk2::Button will execute the application and save the output into a Gtk2::TextBuffer which will be displayed in Gtk2::TextView. At the moment, if the button is pressed, the whole GUI will 'freeze' and after the application execution is finished, the complete output is displayed. My question is, how can it be done so textview will be updated in real time with the console output instead of waiting the whole execution to be finished. You need to use a pipe-open to read the output of your helper program from a child process. How do i keep my GUI updating while doing a long file read? http://live.gnome.org/GTK2-Perl/FrequentlyAskedQuestions#head-20b1c1d3a92f0c61515cb88d15e06b686eba6cbc -- It's all very complicated and would take a scientist to explain it. -- MST3K ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list
re: Displaying console output
You can put this line throughout your code or in a loop to update pending events (This is also good to use for updating progress bars.) # Run the main loop as long as events are pending Gtk2-main_iteration while ( Gtk2-events_pending ); You can also use POE (Perl Object Environment) which allows your program to multitask. Message: 1 Date: Mon, 21 Apr 2008 17:12:51 -0700 (PDT) From: Thomas Rosario [EMAIL PROTECTED] Subject: Displaying console output To: gtk-perl-list@gnome.org Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=us-ascii Hi All, I'm trying to build a GUI to show console output of an existing application. What I've done is 'clicked' signal_connect from Gtk2::Button will execute the application and save the output into a Gtk2::TextBuffer which will be displayed in Gtk2::TextView. At the moment, if the button is pressed, the whole GUI will 'freeze' and after the application execution is finished, the complete output is displayed. My question is, how can it be done so textview will be updated in real time with the console output instead of waiting the whole execution to be finished. Many Thanks! ___ gtk-perl-list mailing list gtk-perl-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-perl-list