Real Perl has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks

I wrote code that works under the Windows platform. Now, I want to convert that code over to Linux. Why do some methods like selectionGet() do not work in Linux?

The error I get reads:

Tk::Error: Can't call method "selectionGet" on an undefined value at...... line ....

Tk callback for .button2

Tk::__ANON__ at /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/Tk.pm line 247

Tk::Button::butUp at /usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/Tk/Button.pm line 111

ButtonRelease-1

(command bound to event)

Then the program is just hanging there...

The line of code that generates this error is:

$file_name= $table -> selectionGet;

I would appreciate any help or pointers.

Thank you in advance for your time

Claire

Replies are listed 'Best First'.
Re: selectionGet Method
by thundergnat (Deacon) on Jul 01, 2005 at 10:57 UTC

    Did you check that $table IS defined while running under Linux? Since you didn't even say what kind of widget $table is, it is hard to diagnose from this end, I would guess it is a hlist, but that is just a guess.

    Are you running the same version of Perl/Tk on both machines?

    You will probably get more useful answers if you post the relavant sections of your code.

      Hi,

      The perl versions are different between the Windows and the Linux platforms I am using but the newest version is on the Linux one.

      $table is a hlist. What does IS mean?

      Thanks

      Claire