in reply to Re: Perl/Tk Non-user Interactivity
in thread Perl/Tk Non-user Interactivity

I saw the update method, but I just don't understand how to use it. I have not been able to find any examples.

Replies are listed 'Best First'.
Re: Re: Re: Perl/Tk Non-user Interactivity
by busunsl (Vicar) on Mar 20, 2001 at 20:31 UTC
    Suppose you read from that socket and do the processing in a sub.
    This sub is called somewhere in the main program, probably from a menu.
    You pass a reference to the MainWindow to the sub and inside the sub you call update(), like this:
    . . . my $menu = $menubar->Menubutton(qw/Name menu -tearoff 0 -text somethin +g -underline 0 -menuitems/ => [ [command => 'read socket', -command => [\&read_socket, $MW]], ] )->pack(-side => 'left'); . . . sub read_socket { my $MW = shift; while (some_condition) { do_something_with_socket; $MW->update(); } }