Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: Is there a way to make Prima widgets accept double byte characters?

by ZJ.Mike.2009 (Scribe)
on Jun 08, 2011 at 11:45 UTC ( #908689=note: print w/replies, xml ) Need Help??


in reply to Re^3: Is there a way to make Prima widgets accept double byte characters?
in thread Is there a way to make Prima widgets accept double byte characters?

@dk, thank you for committing the change. I really appreciate it :) But unfortunately the InputLine widget still doesn't work for me :(

I downloaded the dk-Prima-e3c6fd6.zip file, unzipped it and ran the ms_install.pl file. I got Prima installed successfully

But when running a Prima app, Perl gives me the following warnings:

Bareword "km::Unicode" not allowed while "strict subs" in use at C:/Perl/site/li b/Prima/InputLine.pm line 279. Compilation failed in require at C:/Perl/site/lib/Prima/MsgBox.pm line 42. BEGIN failed--compilation aborted at C:/Perl/site/lib/Prima/MsgBox.pm line 42. Compilation failed in require at (eval 72) line 1. BEGIN failed--compilation aborted at (eval 72) line 1. BEGIN failed--compilation aborted at E:\vb.pl line 27.

Okay, that's not a real problem. I commented out the use strict; line in the InputLine.pm and Edit.pm and running my Prima app again. This time the Prima showed up and then I tried to enter some Chinese characters in the InputLine widget but it didn't work. The widget still refused to accept any IME input. By any I mean I can select English words through the IME but English words from the IME can't be entered in the InputLine widget either. I'm not a GTk user and I don't know if I can enter IME characters with GTk. But both wxPerl and Perl Tk accept IME input from my Chinese system. It's just weird. I'll give it some more tries. Anyway thank you for the effort.
  • Comment on Re^4: Is there a way to make Prima widgets accept double byte characters?

Replies are listed 'Best First'.
Re^5: Is there a way to make Prima widgets accept double byte characters?
by dk (Chaplain) on Jun 08, 2011 at 16:33 UTC
    Hi,

    Can you write me to dmitry@karasik.eu.org? This way we could solve the problem more productively. Also, can you tell which IME did you install? I've installed one called "Chinese Traditional Array 6.0" something, chances are that if you used something else, I should try it too.

    Also, it wouldn't work the way you installed it - you need to run

    perl Makefile.PL dmake dmake install
    (assuming you've running strawberry perl, some other make or nmake otherwise)
      While you're fixing stuff, how to do multiple apps?
      #!/usr/bin/perl -- use strict; use warnings; Main( @ARGV ); exit( 0 ); sub Main { ShowPrima(); ShowPrima(); } sub ShowPrima { require Prima ; require Prima::Buttons; require Prima::Application; $::application ||= Prima::Application-> create( qw' name Prima '); my $mw = Prima::MainWindow->create( text => 'Hello world!', size => [ 200, 200], ); $mw-> insert( Button => centered => 1, text => 'Hello world!', onClick => sub { $::application-> close }, ); #~ Prima->run; $::application ->go; } __END__ Illegal object reference passed to Component.get_components at C:/perl +/site/5.12.2/lib/MSWin32-x86-multi-thread/Prima/Classes.pm line 193.
        Seems like a bug, or at least as an unintended use . Will try to fix, watch github for changes. Meanwhile, would that help you?
        #!/usr/bin/perl -- use strict; use warnings; Main( @ARGV ); exit( 0 ); sub Main { ShowPrima(); ShowPrima(); } sub ShowPrima { require Prima ; require Prima::Buttons; require Prima::Application; $::application ||= Prima::Application-> create( qw' name Prima '); + my $mw = Prima::MainWindow->create( text => 'Hello world!', size => [ 200, 200], ); $mw-> insert( Button => centered => 1, text => 'Hello world!', onClick => sub { $mw-> cancel }, ); $mw-> execute; }

      Thank you, Dmitry!

      It finally works although with many problems. But it's on the right track :) LOL

      I added extra two lines of code which I mentioned earlier in this thread and then as you suggest I did the "makefil.pl dmake dmake install" 3-step installation rather than just running ms_install.pl.
      case WM_IME_CHAR: ev. key. code = mp1;
      It now works but with a lot of problems. Okay, I'll write to the mail address you specified with more details.

      Thank you again!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://908689]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2022-12-08 18:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?