Steffen Schwigon <[EMAIL PROTECTED]> writes:
> Richard Hainsworth <[EMAIL PROTECTED]> writes:
>> use perl5:Wx;
>> my $app =;
>> my $, -1, 'Hello world!');
>> $frame.Show;
>> $app.MainLoop;
>> The following is the result:
>> $pugs wxtest.p6
>> *** No compatible subroutine found: "&Wx::SimpleApp"
>>    at wxtest.p6 line 2, column 1-28
>> Is the perl6 wrong?
>> I have also tested
>> use perl5:Wx <SimpleApp>;
> Maybe an additional
>  use perl5:Wx::SimpleApp;
> ? I'm just guessing...

Hm. Generally I have much more success using Perl5 modules with Pugs
6.2.13. But maybe Wx is a bit harder. I tried to trick it with an
additional Perl5 helper to not use the indirect namespaces, like this: (Perl5):

    package WxHelper;
    use Wx;
    sub new_SimpleApp {
        return Wx::SimpleApp->new(@_);
    sub new_Frame {
        return Wx::Frame->new(@_);

This adapted to your little program (Perl6):

    #! /usr/bin/pugs
    use perl5:Wx;
    use perl5:WxHelper;
    my $app   = WxHelper.new_SimpleApp;
    my $frame = WxHelper.new_Frame(undef, -1, 'Hello world!');

But now I get 

  sub must be a CODE reference at /usr/local/lib/perl/5.8.7/Wx/ line 36.

I don't know Wx, maybe you have an idea for this, e.g. another way to
start a mini application. 

BTW, I tried it on Linux with GTK bindings.

Steffen Schwigon <[EMAIL PROTECTED]>
Dresden Perl Mongers <>

Reply via email to