Bingo!  I changed my subs to:

 sub geo_codes_Click {
        $sel = $geo_codes->SelectedItem();
        if ($sel != -1 ) {$updown2->Pos($sel);}
 }

(lifted from sample code I must confess) and happiness returns.

Larry

-----Original Message-----
From: Glenn Linderman [mailto:[EMAIL PROTECTED]
Sent: Friday, March 09, 2001 11:50 AM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: Re: [perl-win32-gui-users] use of Pos method


"Moore, Larry" wrote:

> ->Select() doesn't work, I tried it, because $updown1 and $updown2 are
> UpDown objects and Pos is the method for this object.  If I comment out
the
> two lines which set the Pos, then the program dies immediately.

I suspect this latter death is caused by the lack of an appropriate return
value.  Event subs return -1/0/1 to result in death/no action/default action
respectively.

When you comment out Pos, the return value is $sel, which is -1 if nothing
is
selected....

I haven't played with UpDown yet, I'm interested to watch future responses
in
this thread.

>
>
> Larry
>
> -----Original Message-----
> From: Peter Eisengrein [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 08, 2001 2:34 PM
> To: 'perl-win32-gui-users@lists.sourceforge.net'
> Subject: RE: [perl-win32-gui-users] use of Pos method
>
> Do you want ->Pos() or ->Select()? I suspect you probably want the latter.
>
> -----Original Message-----
> From: Moore, Larry [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 08, 2001 1:49 PM
> To: 'perl-win32-gui-users@lists.sourceforge.net'
> Subject: [perl-win32-gui-users] use of Pos method
>
> I have two listboxes each as the Buddy to an UpDown object.
>
> I want to synchronize the selected item for the two listboxes.
>
> I use two click event subroutines to allow selection in the list, as well
as
> two scroll events.  I get an error message saying that the Pos method is
not
> available in my click subs, but after responding ok to these two messages,
> one for each sub, my code seems to perform as I expect.  What am I doing
> wrong?  Here is the code:
>
> sub ud1_Scroll {
>         geo_codes_Click();
> }
>
> sub ud2_Scroll {
>         geo_names_Click();
> }
>
> sub geo_codes_Click {
>         $sel = $geo_codes->SelectedItem();
>         $updown2->Pos($sel);
> }
>
> sub geo_names_Click {
>         $sel = $geo_names->SelectedItem();
>         $updown1->Pos($sel);
> }
>
> Tks,
> Larry
>
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
>
> _______________________________________________
> Perl-Win32-GUI-Users mailing list
> Perl-Win32-GUI-Users@lists.sourceforge.net
> http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users

--
Glenn
=====
Even if you're on the right track,
you'll get run over if you just sit there.
                       -- Will Rogers



_______________________________________________
Perl-Win32-GUI-Users mailing list
Perl-Win32-GUI-Users@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users

Reply via email to