RE: Prima::tutorial and Prima::MainWindow derived class example not working on XP and ActivePerl

From: David Christensen <dpchrist_at_holgerdanske.com>
Date: Thu, 10 Apr 2008 21:52:40 -0700
To: <prima_at_BSD-Dk.dk>

Dmitry Karasik wrote:
> The example didn't have 'use Prima qw(Application)' in the beginning
> and 'run Prima' in the end, because I thought that was obviously
> unnecessary repetition -- but as it is not really so, I'll add these
> to avoid confusion.

Thank you for the reply. :-)

I was blindly cutting and pasting. Given that the first several
examples appeared to be complete programs, I just assumed they all were.
It now works with the corrections you described. :-) (See console
session, below.)

David

C:\Documents and Settings\dpchrist\My Documents\prima>type
menu-actions.pl
#! /usr/bin/perl -w
use strict;
use Prima qw(Application);
package MyWindow;
use vars qw(@ISA);
@ISA = qw(Prima::MainWindow);
sub action
{
    my ( $self, $menu_item) = @_;
    print "hey! $menu_item called me!\n"
}
my $window = MyWindow-> new(
    menuItems => [
        [ '~File' => [
        ['~Action', q(action) ],
        ]],
    ],
);
run Prima;

C:\Documents and Settings\dpchrist\My Documents\prima>perl
menu-actions.pl
hey! #2 called me!
Received on Fri 11 Apr 2008 - 06:52:41 CEST

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:06 CET