logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Embedded perl5 modules: msg#00021

Subject: Re: Embedded perl5 modules
Steffen: Sorry, Didnt see all correspondence immediately, and hence responded twice.

But here is an effort using Gtk2. It works.
Can anyone explain why the lines with .can, whilst the other syntaxes dont work?

<file Gtk2Helper.pm>
package Gtk2Helper;
use Gtk2;
sub new_Window {
   return Gtk2::Window->new(@_);
};
sub new_Button {
   return Gtk2::Button->new(@_);
};
1;
<end file>
<file Gtk2_test.p6>
use perl5:Gtk2;
use perl5:Gtk2Helper;

Gtk2.init;

#This does not work
#my $window = Gtk2Helper.new_Window('toplevel');
#This does not work
#my $window = Gtk2Helper::new_Window('toplevel');

# The following works
my &nw := Gtk2Helper.can('new_Window');
my $window = nw('toplevel');

my &nb := Gtk2Helper.can('new_Button');
my $button = nb('Quit this dull mortal world');
$button.signal_connect('clicked', sub { Gtk2.main_quit });
$window.add($button);
$window.show_all;
Gtk2.main;

Richard

Steffen Schwigon wrote:
Richard Hainsworth <richard@xxxxxxxxxxxx> writes:
Tried
use perl5:Wx::SimpleApp;
but the compiler complained it could not find SimpleApp.pm

Did you see my other suggestion with an intermediate "WxHelper"
(http://www.nntp.perl.org/group/perl.perl6.users/546)?

It also doesn't really work but at least it gets you a step
further. Try it and maybe you have the next idea as you maybe know Wx better than I do.
Steffen




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>