in reply to using Tkx new_ttk__entry AND tk___getOpenFile

Hello i'm a french newby in Perl.

What are the implications of this? I mean le implicationes?

update: I was right $lacolonne, its in like la french :)

update: pod lines newline after commands paragraphs, as in =head1 NAME\n\nNAME - the is le

If you use scriptdist it will insert a template pod of the right form, like

=head1 NAME $script_name - this script does something =head1 SYNOPSIS =head1 DESCRIPTION =head1 AUTHOR =head1 COPYRIGHT =cut

update: Oh, so it prompts for a csv file, i give a random one, then prompts something in french, and yes, i see the problem, can't write in the entries.

This works

#!/usr/bin/perl -- use strict; use warnings; use Tkx; local $Tkx::TRACE=64; my $the_shining = "Here's Johnny! 0"; my $mw = Tkx::widget->new("."); my $b = $mw->new_ttk__button( -text => 'Hello, world', -command => sub { $the_shining =~ s/(\d+)/$1+1/e; return; }, ); $b->g_pack; my $e = $mw->new_ttk__entry( -width => 9, -textvariable => \$the_shining, ); $e->g_pack( -expand => 1, -fill => 'both', ); Tkx::MainLoop(); __END__

For CSV, you should use one of Text::CSV// Text::CSV_XS/Text::xSV

See also tkx grid example and tutorial

update: the entries in your program can get focus if your program loses focus, then gains focus again. I have no idea what is at work here :/ but you can do this programatically

$mw->g_wm_withdraw(); $mw->g_wm_deiconify(); Tkx::MainLoop();

For future reference, esp GUI problems, its best to trim all file operations from your program :) See How do I post a question effectively?

Replies are listed 'Best First'.
Re^2: using Tkx new_ttk__entry AND tk___getOpenFile
by x-lours (Sexton) on Dec 12, 2011 at 11:38 UTC

    Thanks a lot !

    you find the trouble : loosing focus. your code is efficient and is enough for me.
    $mw->g_wm_withdraw(); $mw->g_wm_deiconify(); Tkx::MainLoop();

    also thanks for the tutorial.

    i was looking for some ;-)

    i found this code :
    Tkx::focus(-force => $mw);
    which works well also. (when you know what your are searching for ...)