in reply to Re: PAR and Tk
in thread PAR and Tk
Perl version: ActiveState 5.8
Tk version: 800.025
Ok, it nmakes fine, then when I nmake test it gives me a bunch of error messages. Mostly 'Can't locate hidden_print.pm or hidden_print_caller.pm'
But in the end it doesn't complain too much.
Now to test...
Aaand... same result. Character encoding problems.
Code in <readmore>
#!/usr/bin/perl use warnings; use strict; use Net::Dict; use Tk; use Tk::Adjuster; use Tk::ROText; use Tk::Scrollbar; use Tk::Menu; use Tk::Text; my @defs; my $mw = new MainWindow; my $frame = $mw->Frame(); my $list = $frame->Scrolled('Listbox', -scrollbars => 'onoe'); my $defw = $frame->Scrolled('ROText', -scrollbars => 'onoe'); my $aj = $frame->Adjuster(-widget => $list, -side => 'left'); my $wordbox = $mw->Entry(); $frame->pack(-fill => 'both', -expand => 1); $list->pack(-side => 'left', -fill => 'both', -expand => 1); $aj->packAfter($list, -side => 'left'); $defw->pack(-side => 'right', -fill => 'both', -expand => 1); $wordbox->pack(-side => 'left', -fill => 'x', -expand => 1); $wordbox->bind('<Return>', \&get_words); $list->bind('<<ListboxSelect>>', \&get_def); sub get_words { my $dict = Net::Dict->new('dict.org'); my $h = $dict->define($wordbox->get); my $result; my $n = 0; foreach my $i (@{$h}) { my ($db, $def) = @{$i}; $list->insert('end', $db); $defs[$n] = $def; $n++; } } sub get_def { my @deftoget = $list->curselection; print @deftoget; $wordbox->delete(0, 'end'); my $result = $list->get($deftoget[0])."\n$defs[$deftoget[0]]\n\n"; $defw->Contents($result); } MainLoop; exit 0;
All I did was pp dict.pl, then run a.exe and I get the char encoding.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: PAR and Tk
by graff (Chancellor) on May 16, 2004 at 14:01 UTC | |
by nornagon (Acolyte) on May 17, 2004 at 05:41 UTC | |
by graff (Chancellor) on May 18, 2004 at 00:58 UTC |