Re: External subroutines

From: Alan None <alan_x2cvb_at_yahoo.com>
Date: Tue, 3 May 2005 21:24:29 -0700 (PDT)
To: Anton Berezin <tobez_at_tobez.org>

Thanks, Anton!

Now it works. It took me a day or two to realize that
I had to do @$main::arrayname for an array (sigh), but
anyway...

BTW, I started with onChange but switched to onKeyUp
because I wanted to set a key combo (Shift + Enter) to
allow user control of when to add the text to the
array.

Alan

 
--- Anton Berezin <tobez_at_tobez.org> wrote:
> On Mon, May 02, 2005 at 08:53:47PM -0700, Alan None
> wrote:
>
> > I just discovered Prima and am having great fun
> with
> > it. Since I know little OOP, I began playing with
> the
> > sample Image Viewer app in the VB and in short
> order
> > added "zoom in/out" buttons and a "save file"
> option.
> > Also got the InputLine to send any changes to a
> Label
> > widget I added to the Form.
> >
> > But now I'm stuck: In a new application, I want to
> > store changes to one or more InputLines in some
> data
> > structures (array or hash) . At some point, I
> would do
> > some operations on this and then save the results
> to a
> > file, manipulate them in some way, or pass them to
> > another widget. But I can't get it to work with
> even
> > one InputLine and a simple array @textlines.
> >
> > If I define the array anywhere but in the event
> > ('InputLine1' =>OnKeyUp) where I push data into
> it, I
> > get a "Can't call method "execute" on an
> undefined
> > value" when I run the app. If I define the array
> in
> > the event where I add the data, no error but it
> only
> > stores that one piece of data.
>
> Hmm. I would use probably onChange notification
> instead of onKeyUp with
> it's code being something like this:
>
> my $self = $_[0];
> $main::value = $self->text;
>
> Where $main::value is your scalar (or array, or
> whatever) defined in the
> main body of the program.
>
> =Anton.
> --
> The moronity of the universe is a monotonically
> increasing function. --
> Jarkko Hietaniemi
>

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
Received on Wed 04 May 2005 - 06:24:37 CEST

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