Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

RE: screen display only updates on callback to text widget: msg#00009

lang.perl.tk

Subject: RE: screen display only updates on callback to text widget

Bill,

Glad to hear that did the trick. Actually it is documented in the pod for Tk::Widget. It seems this method
is inherited by all tk widgets. There is also an idletasks method which does updating as well. I have had mixed
success using idletasks, so I tend to use the update method. Maybe some on the list more advanced than
me can point out when it is best to use one method over the other. You can see perldoc Tk::Widget for the information.

Regards,

Mike



At 07:30 PM 5/6/2005, Bill Mezian wrote:
Mike,

Thanks for the speedy response. You were right on the money. The update()
function seems to be what was missing from the docs (or my interpretation of
them).

It was not necessary to update the main window, a call to $t->update() after
a $t->insert worked for the read only text widget in all instances, and for
the progress bar as follows:
$percent_done += 5;
$progress->update();

This would have to carry less overhead than updating the main window and all
embedded widgets.

Thanks again,

All the best,
Bill

-----Original Message-----
From: Michael van Nieuwenhuize [mailto:michaelv@xxxxxxxxxxxx]
Sent: Friday, May 06, 2005 6:18 PM
To: bill@xxxxxxxxxxxxxx; ptk@xxxxxxxxxxxxxxxxxx
Subject: Re: screen display only updates on callback to text widget


Bill,

The is a update method for your mainwindow.

$mainWindow->update();

When ever you call this method it will update the entire gui. I think each
widget might
also inherit this method. So you may want to try $t->update after each read
to see
if it works. If not you could update mainwindow in your read loop. Not sure
been a while since
I have done any work with text widgets. If I remember correctly update can
eat up resources
so you may have to do some experimentation to see what works best for you.


Regards,

Mike

At 03:01 PM 5/6/2005, Bill Mezian wrote:
>Hello all,
>
>On the Win32 platform using active State 5.8x, I have a program that while
>processing a file, writes updates to a text widget, with processing
>beginning by a command subroutine from a button press:
>
>$f ->Button(-text => "Process New",
> -font => 'tahoma 8 bold',
> -activebackground => '#D0C36B',
> -command => \&process_data_file)
> ->pack(-side => 'left', -expand => 1, -fill => 'x', -pady
=>
>1, -anchor => 'w');
>
>The callback to the ROText widget is:
>
>$t->insert("end", "Adding ". $dlrstnum . " " . $year . " " . $make . " " .
>$model . "\n");
>
>called from within a while loop. My problem is this, the screen display
only
>updates after all of the processing has finished, rather than writing each
>line out to the window as it is being processed.
>
>Can anyone help with a suggestion on how to get the screen display to
update
>as the file is processing? The behavior is also the same using a progress
>bar, and output from a ping command to the same text widget.
>
>Thanks for any help!
>
>Bill
>
>-++**==--++**==--++**==--++**==--++**==--++**==--++**==
>This message was posted through the Stanford campus mailing list
>server. If you wish to unsubscribe from this mailing list, send the
>message body of "unsubscribe ptk" to majordomo@xxxxxxxxxxxxxxxxxx

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@xxxxxxxxxxxxxxxxxx



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
hardware.arm.at...    cms.citadel.dev...    video.gstreamer...    java.facelets.u...    misc.basics.qna...    web.wiki.instik...    network.uip.use...    xdg.devel/2003-...    tex.bibtex.bibd...    finance.quotesp...    ietf.zeroconf/2...    redhat.blinux.g...    suse.db2/2003-0...    php.phpesp/2004...    uml.devel/2003-...    gnome.labyrinth...    qnx.openqnx.dev...    boot-loaders.gr...    db.dataperfect....    audio.audacity....    linux.uclinux.m...    editors.j.devel...    os.openbsd.tech...    kde.users.multi...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation