Yes - it works now.
I tested on an XP pc with new ActiveState perl (5.10) -earlier it was on a 5.8.
Thanks anyway
On Sun, May 4, 2008 at 1:50 PM, Erez Schatz <[EMAIL PROTECTED]> wrote:
> Works for me, in the sense that after choosing a file, both buttons -
>
> > $mw->Button( -text=>'Quit', -command=>sub{ exit } )->pack(
> > -side=>'right' );
> > $mw->Button( -text=>'Quit', -command=>sub{ exit } )->pack;
> are clickable and both quit the application.
>
> It also shows the file name and the filename+"_949.sav";
>
> Try giving a specific test case that will be of assistance here,
> otherwise I can't replicate it.
>
>
>
> On Sun, May 4, 2008 at 1:08 PM, Oren Maurer <[EMAIL PROTECTED]> wrote:
> > Hi all.
> >
> > I'm trying to write a small GUI using Perl/Tk.
> > It should select a file, and than - display it's name and by pressing
> > a button – do something.
> >
> >
> > After using my $inputfilename = $mw->getOpenFile(-filetypes =>
> > $types); all the buttons are un-clickable!
> >
> > Here is my code:
> >
> ==============================================================================
> >
> > #!/usr/bin/perl -w
> > use strict;
> > use Tk;
> > use Tk::DirTree;
> > use Cwd;
> >
> >
> > my $mw = MainWindow->new ();
> > $mw->Label( -text => "Adding 949 field!" );
> >
> > my $types = [
> > ['MARC\XML Files', ['.xml', '.mrc','mrcxml', 'xmlmrc']],
> > ['All Files', '*', ],
> > ];
> >
> > my $inputfilename = $mw->getOpenFile(-filetypes => $types);
> > &see_inputfilename($inputfilename) if defined $inputfilename ;
> > #---
> > sub see_inputfilename {
> > $mw->Label( -text => "$inputfilename" )->pack;
> > }
> >
> > my $outputfilename = "$inputfilename"."_949.sav";
> > &see_outputfilename($outputfilename) if defined $outputfilename;
> > #---
> > sub see_outputfilename {
> > $mw->Label( -text => "$outputfilename" )->pack;
> > }
> >
> > $mw->Button( -text=>'Quit', -command=>sub{ exit } )->pack(
> -side=>'right' );
> > $mw->Button( -text=>'Quit', -command=>sub{ exit } )->pack;
> >
> > sub add_949_field {
> > my ($inputfilename, $outputfilename) = @_;
> > my $inputfilename_val = $inputfilename->get;
> > my $outputfilename_val = $outputfilename->get;
> > return "Taking inputfilename $inputfilename_val to add 949 field
> > into outputfilename $outputfilename_val\n";
> > }
> >
> > MainLoop;
> >
> >
> >
> ==============================================================================
> >
> >
> > --
> > ________________________________
> > Oren Maurer
> > http://www.meorero.org.il
> > _______________________________
> > # =======================|
> > # Please avoid sending me Word |
> > # or PowerPoint attachments |
> > # =======================|
> > # See: http://www.gnu.org/philosophy/no-word-attachments.html
> > _______________________________________________
> > Perl mailing list
> > [email protected]
> > http://perl.org.il/mailman/listinfo/perl
> >
>
>
>
> --
> Erez
>
> It's time to grow out of the browser; we have nothing to lose but our
> metaphors.
> _______________________________________________
> Perl mailing list
> [email protected]
> http://perl.org.il/mailman/listinfo/perl
>
--
________________________________
Oren Maurer
http://www.meorero.org.il
_______________________________
# =======================|
# Please avoid sending me Word |
# or PowerPoint attachments |
# =======================|
# See: http://www.gnu.org/philosophy/no-word-attachments.html
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl