Ah. I was using the ppm version (version 0.75) *downloads*

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.


In reply to Re: Re: PAR and Tk by nornagon
in thread PAR and Tk by nornagon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.