in reply to Tkx combobox error on quit

Hi, here is a Tk version of what I think you want. I have no idea what Tkx does, but the idea should be the same.
#!/usr/bin/perl -w use strict; use Tk qw/tkinit DoOneEvent exit DONT_WAIT ALL_EVENTS/; use Tk::JComboBox; my $mw = MainWindow->new(); my $combo = $mw->JComboBox( -choices => [ { -name => 'Black', -value => 1 }, { -name => 'Blue', -value => 2 }, { -name => 'Green', -value => 3 }, { -name => 'Purple', -value => 4 }, 'Red', { -name => 'Yellow', -value => 5 } ] )->pack; my $count = 0; my $timer = $mw->repeat(1000,sub{ $count++; }); while ( Tk::Exists($mw) ) { $mw->DoOneEvent( DONT_WAIT | ALL_EVENTS ); print "$count\n"; if( $count > 10 ){ $mw->destroy } } print "end of gui, press a key to continue\n"; <>; print "exiting\n";

I'm not really a human, but I play one on earth Remember How Lucky You Are

Replies are listed 'Best First'.
Re^2: Tkx combobox error on quit
by Anonymous Monk on Sep 22, 2008 at 20:07 UTC

    Hi.

    In Tkx, there's Tkx::i::DoOneEvent(), which I also tried, but it's horribly slow (I believe it does literally ONE event each time it's called). Is there a Tkx equivalent of ( DONT_WAIT | ALL_EVENTS )? That looks like it would do what I need, but I've been unsuccessful with the Google on that one. Tkx.pm passes all arguments of DoOneEvent to Tcl/Tk, and I've tried all sorts of ways of putting ( DONT_WAIT | ALL_EVENTS ) in there without success.

    Thanks.

        Tkx is closer to "pure" Tk (meaning Tcl/Tk) than perl/Tk, so there is much more chances to write better quality software in Tkx than in perl/Tk.

        Perl/Tk is outdated by construction.