Re: Perl/Tk

2017-05-16 Thread Shlomi Fish
On Tue, 16 May 2017 20:35:55 +0900
Masayoshi Fujimoto  wrote:

> Hi.
> I really appriciate your help. It worked for me.
> 

You're welcome!

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl/Tk

2017-05-16 Thread Shlomi Fish
Hi!

On Tue, 16 May 2017 20:11:52 +0900
Masayoshi Fujimoto  wrote:

> Hi.
> 
> I would like to get $celebrity.
> 
> How should I do?
>

I have modified your code based on
https://metacpan.org/pod/distribution/Tk/pod/Entry.pod to get what seems to be
the desired result:

« «
#!/usr/local/bin/perl

use strict;

use warnings;

use autodie;

use v5.10;

use Tk;

my $top = MainWindow->new();

my $f1 = $top->Frame()->pack();

my $f2 = $top->Frame()->pack();

$f1->Label(-text => "Celebrity:")->pack(-side => "left");

my $celebrity = $f1->Entry();

$celebrity->pack(-side => "left");

my $name = "Ayumi Kinoshita";

$f2->Button(-text => "OK",-command => [ \&onButton,
$celebrity,$name])->pack(-side => "left");

$f2->Button(-text => "Cancel",-command => sub {exit;})->pack();

MainLoop();

sub onButton {

my ($celebrity,$name) = @_;

say $celebrity;

say $name;

say "Celebrity string = <", $celebrity->get(), ">";

}

»

One note is http://perl-begin.org/tutorials/bad-elements/#prototypes ,
otherwise your code seems pretty solid.

Regards,

Shlomi

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Perl/Tk

2017-05-16 Thread Masayoshi Fujimoto
Hi.

I would like to get $celebrity.

How should I do?

% perl tk.pl

Tk::Entry=HASH(0x804abddc8)

Ayumi Kinoshita

(tk.pl)

#!/usr/local/bin/perl

use strict;

use warnings;

use autodie;

use v5.10;

use Tk;

my $top = MainWindow->new();

my $f1 = $top->Frame()->pack();

my $f2 = $top->Frame()->pack();

$f1->Label(-text => "Celebrity:")->pack(-side => "left");

my $celebrity = $f1->Entry();

$celebrity->pack(-side => "left");

my $name = "Ayumi Kinoshita";

$f2->Button(-text => "OK",-command => [ \&onButton, 
$celebrity,$name])->pack(-side => "left");

$f2->Button(-text => "Cancel",-command => sub {exit;})->pack();

MainLoop();

sub onButton () {

my ($celebrity,$name) = @_;

say $celebrity;

say $name;

}

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: insert in perl tk

2012-08-24 Thread Shekar
Thanks  for the correction Shlomi.

Mistake from my side, i copy pasted the wrong line from my terminal !!!

--
Shekar


On Fri, Aug 24, 2012 at 2:49 PM, Shlomi Fish  wrote:

> Hi Shekar,
>
> On Fri, 24 Aug 2012 12:23:21 +0530
> Shekar  wrote:
>
> > Try this.
> >
> > $t->insert("end", &gettime);
> >
>
> Please don't recommend people to use leading ampersands in subroutine
> calls:
>
> *
> http://perl-begin.org/tutorials/bad-elements/#ampersand-in-subroutine-calls
>
> * https://www.socialtext.net/perl5/subroutines_called_with_the_ampersand
>
> Instead write:
>
> $t->insert("end", gettime());
>
> Regards,
>
> Shlomi Fish
>
> >
> > --
> > Shekar
> >
> >
> > On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed
> > wrote:
> >
> > > i have to call localtime () function to get the latest time
> > > everytime when i print the lines using insert method
> > > i mean , i need to print the latest time in scrolled text box
> > >
> > > lets say :
> > >
> > > use Tk;
> > > $mw = MainWindow->new();
> > > my $t = $mw->Scrolled("Text")->pack (-side => 'left', -expand=>1);
> > > $t->insert("end", "$c = \&gettime");
> > >
> > > sub gettime
> > > {
> > >  $c = localtime();
> > > return $c;
> > > }
> > >
> > > so whenever i call insert method , it shud call function gettime
> > > and print the latest time in the text box
> > > please suggest
> > >
> > > regards
> > > irfan
> > >
> > >
> > >
> > >
> > >
> > > 
> > >  From: Jim Gibson 
> > > To: Perl Beginners 
> > > Sent: Friday, August 24, 2012 11:13 AM
> > > Subject: Re: insert in perl tk
> > >
> > >
> > > On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote:
> > >
> > > > thanks. this will help to print the contents of array on separate
> > > > line. however, if at all we need to call function then what is
> > > > the syntax, how
> > > we can call that ?
> > >
> > > What function do you want to call? When do you want to call it?
> > > What does the function have to do with the array you want to print?
> > > What does it have to do with Tk?
> > >
> > > >
> > > > please suggest .
> > >
> > > Please let us know in more detail what you are trying to do.
> > >
> > > Thanks.
> > >
> > >
> > > --
> > > To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> > > For additional commands, e-mail: beginners-h...@perl.org
> > > http://learn.perl.org/
> > >
>
>
>
> --
> -
> Shlomi Fish   http://www.shlomifish.org/
> Rethinking CPAN - http://shlom.in/rethinking-cpan
>
> Bill Gates, CEO of Microsoft decides to use Richard Stallman’s Emacs as the
> basis of his company’s state‐of‐the‐art product Microsoft Editing Macros™
> Enterprise Edition XP .NET Professional.
>
> Please reply to list if it's a mailing list post - http://shlom.in/reply .
>


Re: insert in perl tk

2012-08-24 Thread Shlomi Fish
Hi Shekar,

On Fri, 24 Aug 2012 12:23:21 +0530
Shekar  wrote:

> Try this.
> 
> $t->insert("end", &gettime);
> 

Please don't recommend people to use leading ampersands in subroutine calls:

* http://perl-begin.org/tutorials/bad-elements/#ampersand-in-subroutine-calls

* https://www.socialtext.net/perl5/subroutines_called_with_the_ampersand

Instead write:

$t->insert("end", gettime());

Regards,

Shlomi Fish

> 
> --
> Shekar
> 
> 
> On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed
> wrote:
> 
> > i have to call localtime () function to get the latest time
> > everytime when i print the lines using insert method
> > i mean , i need to print the latest time in scrolled text box
> >
> > lets say :
> >
> > use Tk;
> > $mw = MainWindow->new();
> > my $t = $mw->Scrolled("Text")->pack (-side => 'left', -expand=>1);
> > $t->insert("end", "$c = \&gettime");
> >
> > sub gettime
> > {
> >  $c = localtime();
> > return $c;
> > }
> >
> > so whenever i call insert method , it shud call function gettime
> > and print the latest time in the text box
> > please suggest
> >
> > regards
> > irfan
> >
> >
> >
> >
> >
> > 
> >  From: Jim Gibson 
> > To: Perl Beginners 
> > Sent: Friday, August 24, 2012 11:13 AM
> > Subject: Re: insert in perl tk
> >
> >
> > On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote:
> >
> > > thanks. this will help to print the contents of array on separate
> > > line. however, if at all we need to call function then what is
> > > the syntax, how
> > we can call that ?
> >
> > What function do you want to call? When do you want to call it?
> > What does the function have to do with the array you want to print?
> > What does it have to do with Tk?
> >
> > >
> > > please suggest .
> >
> > Please let us know in more detail what you are trying to do.
> >
> > Thanks.
> >
> >
> > --
> > To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> > For additional commands, e-mail: beginners-h...@perl.org
> > http://learn.perl.org/
> >



-- 
-
Shlomi Fish   http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

Bill Gates, CEO of Microsoft decides to use Richard Stallman’s Emacs as the
basis of his company’s state‐of‐the‐art product Microsoft Editing Macros™
Enterprise Edition XP .NET Professional.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: insert in perl tk

2012-08-24 Thread Irfan Sayed
thanks. 
it worked!

regards
irfan


From: Shekar 
To: Irfan Sayed  
Cc: Jim Gibson ; Perl Beginners  
Sent: Friday, August 24, 2012 12:23 PM
Subject: Re: insert in perl tk
 

Try this.

$t->insert("end", &gettime);


--
Shekar



On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed  wrote:

i have to call localtime () function to get the latest time everytime when i 
print the lines using insert method
>i mean , i need to print the latest time in scrolled text box
>
>lets say :
>
>use Tk;
>$mw = MainWindow->new();
>my $t = $mw->Scrolled("Text")->pack (-side => 'left', -expand=>1);
>$t->insert("end", "$c = \&gettime");
>
>sub gettime
>{
> $c = localtime();
>return $c;
>}
>
>so whenever i call insert method , it shud call function gettime and print the 
>latest time in the text box
>
>please suggest
>
>regards
>irfan
>
>
>
>
>
>
> From: Jim Gibson 
>To: Perl Beginners 
>Sent: Friday, August 24, 2012 11:13 AM
>
>Subject: Re: insert in perl tk
>
>
>
>On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote:
>
>> thanks. this will help to print the contents of array on separate line.
>> however, if at all we need to call function then what is the syntax, how we 
>> can call that ?
>
>What function do you want to call? When do you want to call it? What does the 
>function have to do with the array you want to print? What does it have to do 
>with Tk?
>
>>
>> please suggest .
>
>Please let us know in more detail what you are trying to do.
>
>Thanks.
>
>
>--
>To unsubscribe, e-mail: beginners-unsubscr...@perl.org
>For additional commands, e-mail: beginners-h...@perl.org
>http://learn.perl.org/

Re: insert in perl tk

2012-08-23 Thread Shekar
Try this.

$t->insert("end", &gettime);


--
Shekar


On Fri, Aug 24, 2012 at 11:58 AM, Irfan Sayed wrote:

> i have to call localtime () function to get the latest time everytime when
> i print the lines using insert method
> i mean , i need to print the latest time in scrolled text box
>
> lets say :
>
> use Tk;
> $mw = MainWindow->new();
> my $t = $mw->Scrolled("Text")->pack (-side => 'left', -expand=>1);
> $t->insert("end", "$c = \&gettime");
>
> sub gettime
> {
>  $c = localtime();
> return $c;
> }
>
> so whenever i call insert method , it shud call function gettime and print
> the latest time in the text box
> please suggest
>
> regards
> irfan
>
>
>
>
>
> 
>  From: Jim Gibson 
> To: Perl Beginners 
> Sent: Friday, August 24, 2012 11:13 AM
> Subject: Re: insert in perl tk
>
>
> On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote:
>
> > thanks. this will help to print the contents of array on separate line.
> > however, if at all we need to call function then what is the syntax, how
> we can call that ?
>
> What function do you want to call? When do you want to call it? What does
> the function have to do with the array you want to print? What does it have
> to do with Tk?
>
> >
> > please suggest .
>
> Please let us know in more detail what you are trying to do.
>
> Thanks.
>
>
> --
> To unsubscribe, e-mail: beginners-unsubscr...@perl.org
> For additional commands, e-mail: beginners-h...@perl.org
> http://learn.perl.org/
>


Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
i have to call localtime () function to get the latest time everytime when i 
print the lines using insert method
i mean , i need to print the latest time in scrolled text box

lets say :

use Tk;
$mw = MainWindow->new();
my $t = $mw->Scrolled("Text")->pack (-side => 'left', -expand=>1);
$t->insert("end", "$c = \&gettime");

sub gettime 
{
 $c = localtime();
return $c;
}

so whenever i call insert method , it shud call function gettime and print the 
latest time in the text box 
please suggest

regards
irfan






 From: Jim Gibson 
To: Perl Beginners  
Sent: Friday, August 24, 2012 11:13 AM
Subject: Re: insert in perl tk
 

On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote:

> thanks. this will help to print the contents of array on separate line.
> however, if at all we need to call function then what is the syntax, how we 
> can call that ?

What function do you want to call? When do you want to call it? What does the 
function have to do with the array you want to print? What does it have to do 
with Tk?

> 
> please suggest .

Please let us know in more detail what you are trying to do.

Thanks.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

Re: insert in perl tk

2012-08-23 Thread Jim Gibson

On Aug 23, 2012, at 9:35 PM, Irfan Sayed wrote:

> thanks. this will help to print the contents of array on separate line.
> however, if at all we need to call function then what is the syntax, how we 
> can call that ?

What function do you want to call? When do you want to call it? What does the 
function have to do with the array you want to print? What does it have to do 
with Tk?

> 
> please suggest .

Please let us know in more detail what you are trying to do.

Thanks.


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
thanks. this will help to print the contents of array on separate line.
however, if at all we need to call function then what is the syntax, how we can 
call that ?

please suggest .

regards
irfan




 From: Shawn H Corey 
To: beginners@perl.org 
Cc: Irfan Sayed  
Sent: Thursday, August 23, 2012 11:40 PM
Subject: Re: insert in perl tk
 
On Thu, 23 Aug 2012 10:51:09 -0700 (PDT)
Irfan Sayed  wrote:

> i need to print the contents of array on separate line , so , i
> thought , i should write one function where i will print the contents
> of array on each line

Do you mean you want each item from an array on each line? If so:

    $t->insert("end", join( "\n", @array ));

See `perldoc -f join` for details.


-- 
Just my 0.0002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

    _Perl links_
official site   : http://www.perl.org/
beginners' help : http://learn.perl.org/faq/beginners.html
advance help    : http://perlmonks.org/
documentation   : http://perldoc.perl.org/
news            : http://perlsphere.net/
repository      : http://www.cpan.org/
blog            : http://blogs.perl.org/
regional groups : http://www.pm.org/

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/

Re: insert in perl tk

2012-08-23 Thread Shawn H Corey
On Thu, 23 Aug 2012 10:51:09 -0700 (PDT)
Irfan Sayed  wrote:

> i need to print the contents of array on separate line , so , i
> thought , i should write one function where i will print the contents
> of array on each line

Do you mean you want each item from an array on each line? If so:

$t->insert("end", join( "\n", @array ));

See `perldoc -f join` for details.


-- 
Just my 0.0002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

_Perl links_
official site   : http://www.perl.org/
beginners' help : http://learn.perl.org/faq/beginners.html
advance help: http://perlmonks.org/
documentation   : http://perldoc.perl.org/
news: http://perlsphere.net/
repository  : http://www.cpan.org/
blog: http://blogs.perl.org/
regional groups : http://www.pm.org/

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: insert in perl tk

2012-08-23 Thread Jim Gibson

On Aug 23, 2012, at 10:51 AM, Irfan Sayed wrote:

> it was quite rude. anyway 

What was quite rude?

> lets say if i have to display the contents of array using insert method.
> if i just type :  $t->insert("end", "@arr1");
> then surely , it will print the contents of array but on the same line 

I don't use Perl/Tk, but I am assuming $t is some sort of Tk widget, and you 
are attempting to add a string to the end of it. Maybe you can post a short, 
complete program that demonstrates what you are trying to do.

> 
> i need to print the contents of array on separate line , so , i thought , i 
> should write one function where i will print the contents of array on each 
> line and call that function from insert method
> please suggest

I would recommend putting whatever you want to insert into a scalar variable 
and inserting that by making it the second argument of your insert statement. 
For example, if you want to insert the elements of an array, one element per 
line, do this:

my $text = join("\n",@arr1);
$t->insert('end', $text);


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
it was quite rude. anyway 
lets say if i have to display the contents of array using insert method.
if i just type :  $t->insert("end", "@arr1");
then surely , it will print the contents of array but on the same line 

i need to print the contents of array on separate line , so , i thought , i 
should write one function where i will print the contents of array on each line 
and call that function from insert method
please suggest

regards
irfan




 From: John SJ Anderson 
To: "beginners@perl.org"  
Sent: Thursday, August 23, 2012 10:54 PM
Subject: Re: insert in perl tk
 
On Thursday, August 23, 2012 at 10:15 AM, Irfan Sayed wrote:
> can someone please suggest ?
> 

Explain what you're actually trying to achieve, instead of asking how to do 
what you think will let you accomplish what you're trying to achieve.

Yes, if you write the insert() method properly, you could certainly pass it 
those two arguments and have it call the second one (you don't need to quote 
the function reference, however). BUT I can't think of a good reason why you'd 
want to do that, so you need to explain what you're actually trying to do, 
because what you're asking about looks really silly. 

Also, 6.5 hours is not a terribly long time to wait for an answer on this list. 
Please be more patient in the future before sending additional traffic. 

j.

Re: insert in perl tk

2012-08-23 Thread John SJ Anderson
On Thursday, August 23, 2012 at 10:15 AM, Irfan Sayed wrote:
> can someone please suggest ?
> 

Explain what you're actually trying to achieve, instead of asking how to do 
what you think will let you accomplish what you're trying to achieve.

Yes, if you write the insert() method properly, you could certainly pass it 
those two arguments and have it call the second one (you don't need to quote 
the function reference, however). BUT I can't think of a good reason why you'd 
want to do that, so you need to explain what you're actually trying to do, 
because what you're asking about looks really silly. 
 
Also, 6.5 hours is not a terribly long time to wait for an answer on this list. 
Please be more patient in the future before sending additional traffic. 

j.




Re: insert in perl tk

2012-08-23 Thread Irfan Sayed
can someone please suggest ?

regards
irfan




 From: Irfan Sayed 
To: "beginners@perl.org"  
Sent: Thursday, August 23, 2012 4:15 PM
Subject: insert in perl tk 
 
hi,

can we call function in the insert method of perl tk ?
i have code like this:

 $t->insert("end", "\&abc");

so when this line gets executed, it should first call function abc
please suggest

regards
irfan

insert in perl tk

2012-08-23 Thread Irfan Sayed
hi,

can we call function in the insert method of perl tk ?
i have code like this:

 $t->insert("end", "\&abc");

so when this line gets executed, it should first call function abc
please suggest

regards
irfan


perl/Tk: How to make the text in the textbox Align Right?

2011-05-28 Thread z sway
Thank You!


Re: Need email list for Perl/Tk questions

2010-02-04 Thread Owen

> Besides this forum, does anyone know of a good Perl/Tk email
> list/forum in which to ask questions about Perl/Tk?

You can try comp.lang.perl.tk which is fairly quiet

-- 



Owen


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Need email list for Perl/Tk questions

2010-02-04 Thread Paul Johnson
On Thu, Feb 04, 2010 at 10:22:00PM +, Tony Esposito wrote:

> Besides this forum, does anyone know of a good Perl/Tk email list/forum in
> which to ask questions about Perl/Tk?

https://mailman.stanford.edu/mailman/listinfo/ptk

It's rather quiet, so be patient.

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Need email list for Perl/Tk questions

2010-02-04 Thread Tony Esposito
Besides this forum, does anyone know of a good Perl/Tk email list/forum in 
which to ask questions about Perl/Tk?



  

Re: Perl-Tk, copy/paste context-menu for entries

2009-08-09 Thread Mishustin Alexey

8/9/2009, "Shawn H. Corey"  вы писали:

>Sorry, I don't know any good resources for Perl/Tk.  When all else
>fails, try perlmonks http://perlmonks.org/

Perlmonks is great! I've already got the answer on my question. Thank
you for your advice again.

--
Regards,
Alex

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl-Tk, copy/paste context-menu for entries

2009-08-09 Thread Mishustin Alexey
В Вск, 09/08/2009 в 15:30 -0400, Shawn H. Corey пишет:
> Mishustin Alexey wrote:
> > В Вск, 09/08/2009 в 07:40 -0400, Shawn H. Corey пишет: 
> >> Mishustin Alexey wrote:
> >>> Hi,
> >>>
> >>> Another question about Perl-Tk.
> >> Try asking on the Beginners Perl/Tk list 
> >> http://lists.cpan.org/showlist.cgi?name=beginning_perl_tk
> > 
> > This mailing list seems to be dead; nothing but spam for the last
> > months.
> > 
> 
> Sorry, I don't know any good resources for Perl/Tk.  When all else 
> fails, try perlmonks http://perlmonks.org/

Thank you, Shawn. I'll try it too.

-- 
Regards,
Alex


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl-Tk, copy/paste context-menu for entries

2009-08-09 Thread Shawn H. Corey

Mishustin Alexey wrote:
В Вск, 09/08/2009 в 07:40 -0400, Shawn H. Corey пишет: 

Mishustin Alexey wrote:

Hi,

Another question about Perl-Tk.
Try asking on the Beginners Perl/Tk list 
http://lists.cpan.org/showlist.cgi?name=beginning_perl_tk


This mailing list seems to be dead; nothing but spam for the last
months.



Sorry, I don't know any good resources for Perl/Tk.  When all else 
fails, try perlmonks http://perlmonks.org/



--
Just my 0.0002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl-Tk, copy/paste context-menu for entries

2009-08-09 Thread Mishustin Alexey
В Вск, 09/08/2009 в 07:40 -0400, Shawn H. Corey пишет: 
> Mishustin Alexey wrote:
> > Hi,
> > 
> > Another question about Perl-Tk.
> 
> Try asking on the Beginners Perl/Tk list 
> http://lists.cpan.org/showlist.cgi?name=beginning_perl_tk

This mailing list seems to be dead; nothing but spam for the last
months.

-- 
Regards,
Alex


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl-Tk, copy/paste context-menu for entries

2009-08-09 Thread Mishustin Alexey
В Вск, 09/08/2009 в 07:40 -0400, Shawn H. Corey пишет:
> Mishustin Alexey wrote:
> > Hi,
> > 
> > Another question about Perl-Tk.
> 
> Try asking on the Beginners Perl/Tk list 
> http://lists.cpan.org/showlist.cgi?name=beginning_perl_tk

OK, thank you.

-- 
Regards,
Alex


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl-Tk, copy/paste context-menu for entries

2009-08-09 Thread Shawn H. Corey

Mishustin Alexey wrote:

Hi,

Another question about Perl-Tk.


Try asking on the Beginners Perl/Tk list 
http://lists.cpan.org/showlist.cgi?name=beginning_perl_tk



--
Just my 0.0002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Perl-Tk, copy/paste context-menu for entries

2009-08-09 Thread Mishustin Alexey
Hi,

Another question about Perl-Tk.

I need to make context-menus with 'Copy' and 'Paste' commands for
'entry' widgets. I found the following syntax for it.

my $popup = $mwindow->Menu(
-tearoff=> 0,
-menuitems  => [
[Button  => 'Copy', -command => [\©]],
[Button  => 'Paste', -command => [\&paste]]
]
);
$where_entry->bind(
""=> sub {$popup->Popup(
-popover=> "cursor",
-popanchor  => 'nw'
)}
);
$limit_entry->bind(
""=> sub{$popup->Popup(
-popover=> "cursor",
-popanchor  => 'nw'
)}
);

sub copy {
#?
}

sub paste {
#?
}

The question is: how to pass the event widget name to subroutines
($where_entry or $limit_entry)?

-- 
Regards,
Alex


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl-Tk, horizontal aligning

2009-08-09 Thread Mishustin Alexey
В Сбт, 08/08/2009 в 16:46 -0400, Shawn H. Corey пишет: 
> Mishustin Alexey wrote:
> > Hi,
> > 
> > I have a question about Perl-Tk.
> > 
> > How to align the content of a cell horizontally, for example, to the
> > left? 
> > 
> > my $where_label = $pane -> Label(
> > -text   =>"Please input WHERE arguments"
> > ) ->grid(
> > -row=> 0,
> > -column => 0,
> > -columnspan => 2
> > );
> > 
> > 
> > Putting options -side or -anchor in grid() and in Label() didn't help, 
> > neither Google... It's always aligned to center.
> > 
> 
> Try: -sticky=>'w',

Thank you! It works.

-- 
Regards,
Alex


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: Perl-Tk, horizontal aligning

2009-08-08 Thread Shawn H. Corey

Mishustin Alexey wrote:

Hi,

I have a question about Perl-Tk.

How to align the content of a cell horizontally, for example, to the
left? 


my $where_label = $pane -> Label(
-text   =>"Please input WHERE arguments"
) ->grid(
-row=> 0,
-column => 0,
-columnspan => 2
);


Putting options -side or -anchor in grid() and in Label() didn't help, 
neither Google... It's always aligned to center.




Try: -sticky=>'w',


--
Just my 0.0002 million dollars worth,
  Shawn

Programming is as much about organization and communication
as it is about coding.

I like Perl; it's the only language where you can bless your
thingy.

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Perl-Tk, horizontal aligning

2009-08-08 Thread Mishustin Alexey
Hi,

I have a question about Perl-Tk.

How to align the content of a cell horizontally, for example, to the
left? 

my $where_label = $pane -> Label(
-text   =>"Please input WHERE arguments"
) ->grid(
-row=> 0,
-column => 0,
-columnspan => 2
);


Putting options -side or -anchor in grid() and in Label() didn't help, 
neither Google... It's always aligned to center.

-- 
Regards,
Alex


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Perl/Tk font question

2009-04-09 Thread Thomas H. George
Since a Toplevel widget has a -title option I assumed it would also have
a -font option.  Specifiying -font => "times 14 normal" produced an
error although this instruction worked on the children of Toplevel.

Is there a way to modify the font used for the title of a Toplevel?

Tom

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/




Re: perl tk question

2007-09-25 Thread patmarbidon

can you add after your 'insert'

$text1->update() to make a refresh.

You need an update if there is no new event in your widget.

Be areful : Don't use update for each line if you insert a lot of lines 
but only at the end of a batch or only every 100 lines to keep good 
performance.







macuser9214 a écrit :
I am trying to make a tk app that parses the qrz callsign ham radio 
database:  It's not working. I'm trying to get information from the text 
field, and the result in the gray box.


#!/usr/bin/perl

use Tk;
use LWP::Simple;
use LWP::UserAgent;





my $main = MainWindow -> new();
 $entry = $main -> Entry();
$entry -> pack;
$main->Button(-text => 'Look Up',
  -command => sub{display($entry)}
  )->pack;



my $text1 = $main->Text ('-width' => 30, '-height' => 15,
  '-background' => 'Grey',)-> pack;

$main->Button(-text => 'Stop', -command => [$main =>
'destroy'])->pack;


sub display {

 $call = $entry;
 $ua = LWP::UserAgent->new();
 $request = HTTP::Request->new('GET', "http://www.qrz.com/detail/$call";);
 $response = $ua->request($request);
$qrz = $response->content;

$qrz =~ m#Name(.*?)#i; my $name = $1;
$qrz =~ m#Addr1(.*?)#i; my $addr1 = $1;
$qrz =~ m#Addr2(.*?)#i; my $addr2 = $1;
$qrz =~ m#Country(.*?)#i; my $country = $1;
$qrz =~ m#Class:(.*?)#i; my $class = $1;
$class =~ s/\ //g;
$class =~ s/^\s+//g;
$class =~ s/\s+$//g;


 $text1->insert('end', "$entry\n");


}





MainLoop;




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




perl tk question

2007-09-25 Thread macuser9214
I am trying to make a tk app that parses the qrz callsign ham radio  
database:  It's not working. I'm trying to get information from the  
text field, and the result in the gray box.


#!/usr/bin/perl

use Tk;
use LWP::Simple;
use LWP::UserAgent;





my $main = MainWindow -> new();
 $entry = $main -> Entry();
$entry -> pack;
$main->Button(-text => 'Look Up',
  -command => sub{display($entry)}
  )->pack;



my $text1 = $main->Text ('-width' => 30, '-height' => 15,
  '-background' => 'Grey',)-> pack;

$main->Button(-text => 'Stop', -command => [$main =>
'destroy'])->pack;


sub display {

 $call = $entry;
 $ua = LWP::UserAgent->new();
 $request = HTTP::Request->new('GET', "http://www.qrz.com/detail/ 
$call");

 $response = $ua->request($request);
$qrz = $response->content;

$qrz =~ m#Name(.*?)#i; my $name = $1;
$qrz =~ m#Addr1(.*?)#i; my $addr1 = $1;
$qrz =~ m#Addr2(.*?)#i; my $addr2 = $1;
$qrz =~ m#Country(.*?)#i; my $country = $1;
$qrz =~ m#Class:(.*?)#i; my $class = $1;
$class =~ s/\ //g;
$class =~ s/^\s+//g;
$class =~ s/\s+$//g;


 $text1->insert('end', "$entry\n");


}





MainLoop;

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Summary: Perl/Tk Help

2007-09-19 Thread CM Analyst
Thanks to patmarbidon and D. Bolliger for their
suggestions. 

I used Pat's suggestion and added: text1->update();
and the script works as I wanted.

Many thanks.

Amad 


   

Yahoo! oneSearch: Finally, mobile search 
that gives answers, not web links. 
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Perl/Tk Help

2007-09-19 Thread patmarbidon

PatMar :

Can you add $text1->update() after your $text1->insert.

widget->update is like a refresh on other X11 windows manager.


CM Analyst a écrit :
Hi All, 


I hope this is still the correct forum to get help
with Perl/Tk...

My goal is display the time in the GUI window but it
doesn't do it quite how I want it to. 


In the GUI, I want the time to display with the sleep
call (set to 1). However, when I use the print
statement and the value goes to STOUT, the time value
displays as I want it to.  


Can someone please tell me what I am missing here?
Thank you,

#
use Tk;
use Time::Local;

my $main = MainWindow->new;

$main->Button (-text => 'Start', -command =>
\&display) -> pack (-side => "left") 
-> pack (-anchor => "n");

$text1 = $main->Text ('-width' => 30, '-height' => 15,
'-background' => Grey,) 
-> pack;

$main->Button(-text => 'Stop', -command => [$main =>
'destroy'])->pack;

sub display { 


for (my $index = 0; $index <= 5; $index++ ) {
my ($sec, $min, $hour, $mday, $mon, $year, $wday,
$yday, $isdst) = localtime();

sleep 1;

#$text1->insert('end', "$hour:$min:$sec\n");

print ("$hour:$min:$sec\n");

}
}

MainLoop;




  

Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
http://autos.yahoo.com/index.html
 







--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Perl/Tk Help

2007-09-18 Thread CM Analyst
Hi All, 

I hope this is still the correct forum to get help
with Perl/Tk...

My goal is display the time in the GUI window but it
doesn't do it quite how I want it to. 

In the GUI, I want the time to display with the sleep
call (set to 1). However, when I use the print
statement and the value goes to STOUT, the time value
displays as I want it to.  

Can someone please tell me what I am missing here?
Thank you,

#
use Tk;
use Time::Local;

my $main = MainWindow->new;

$main->Button (-text => 'Start', -command =>
\&display) -> pack (-side => "left") 
-> pack (-anchor => "n");
$text1 = $main->Text ('-width' => 30, '-height' => 15,
'-background' => Grey,) 
-> pack;
$main->Button(-text => 'Stop', -command => [$main =>
'destroy'])->pack;

sub display { 

for (my $index = 0; $index <= 5; $index++ ) {
my ($sec, $min, $hour, $mday, $mon, $year, $wday,
$yday, $isdst) = localtime();

sleep 1;

#$text1->insert('end', "$hour:$min:$sec\n");

print ("$hour:$min:$sec\n");

}
}

MainLoop;




  

Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
http://autos.yahoo.com/index.html
 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Re: Regarding perl/tk programming

2007-05-15 Thread Nigel Peck

Dharshana Eswaran wrote:

I need to create a GUI and integrate my perl script to it. I decided to get
the GUI using perl/Tk programming. I searched in the net and i am unable to
get a good tutorial or any document regarding the perl/Tk programming.

If anyone knows any links or have any documents, can you please mail it to
me?


Try here:
http://www.perltk.org/index.php?option=com_content&task=section&id=4&Itemid=28

Cheers,
Nigel

Managing Director
MIS Web Design
http://www.miswebdesign.com/

MIS Web Design Limited is registered in England and Wales with company 
number 04561623. Our VAT Registration Number is 803-939-126.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/




Regarding perl/tk programming

2007-05-15 Thread Dharshana Eswaran

Hi All,

I need to create a GUI and integrate my perl script to it. I decided to get
the GUI using perl/Tk programming. I searched in the net and i am unable to
get a good tutorial or any document regarding the perl/Tk programming.

If anyone knows any links or have any documents, can you please mail it to
me?

Thanks and Regards,
Dharshana


RE: perl/Tk and piping questions

2006-08-28 Thread Ken Foskey
On Mon, 2006-08-28 at 12:27 +0200, John Cortland Morgan (ZG/ETK) wrote:
> 
> > This will test for a pipe
> 
> > #!/usr/bin/perl
> > # -t tests if a tty is input, else it's a pipe 
> > 
> > if (@ARGV == 0 and -t) {
> >  die "Usage: $0 INPUT\n";
> >  }
> > 
> > while (<>) {
> >  ## process input file(s) here 
> >  }
> > __END__
> 
> 
> The problem(s) with using -t and <> (as above) are:
> 
> if you give only command line line options, the program will
> hang waiting for input. 
> 

If you use getopts it will consume the options,  just put the test after
the getopts processing.

Other alternative is to use a simple shift.

-- 
Ken Foskey
FOSS developer


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




RE: perl/Tk and piping questions

2006-08-28 Thread John Cortland Morgan \(ZG/ETK\)
Hi,

  Thanks for the tip about  

> The book Mastering Perl/Tk has a pretty good Chapter 3 on Geometry
Management.  
> You can probably read it for free with an sign up at
http://safari.oreilly.com/


about the piping question, it's not an either/or situation. It could be
both.
A good example is the unix wc command. First create a small file

echo "hello" > hello.txt # 6 chars "hello" + "\n"

then do:

# piped input but no command line options (so uses "default" options)
cat hello.txt | wc
1   1   6

# both piped input and command line options
cat hello.txt | wc -c
6

# only command line options
wc -c hello.txt
6

I have tried similar to your suggestion (many different combinations):

> This will test for a pipe

> #!/usr/bin/perl
> # -t tests if a tty is input, else it's a pipe 
> 
> if (@ARGV == 0 and -t) {
>  die "Usage: $0 INPUT\n";
>  }
> 
> while (<>) {
>  ## process input file(s) here 
>  }
> __END__


The problem(s) with using -t and <> (as above) are:

if you give only command line line options, the program will
hang waiting for input. 

If I change it to if-else type decision making, -t causes the
piped input to be ignored.


As I said, I hacked together a subroutine from examples in the
Perl Cookbook, but it's not very elegant:


sub piper {
my @_ARGV = @ARGV; @ARGV = ();  # save command line options (if
any)
my @input = ();

   $SIG{ALRM} = sub { die "timeout" };

   my $pid;
   if ($pid = open(CHILD, "-|")) {  # parent code
while() {# gets piped
input from CHILD (if any)
push @input, $_;
}
close CHILD;
alarm(0);
}
else {  # child code
die "cannot fork: $!" unless defined $pid;

eval {
alarm(1);
while(<>) { print; }# piped input
goes to parent (if any)
alarm(0);
};
exit;
}

@ARGV = @_ARGV; # restore so we can
parse any options
return @input;  # this is any data which
was piped in
}


any comments/suggestions about this solution are greatly appreciated. As
I said, surely there is
a module out there that does this type of thing better?

regards,

John

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




perl/Tk and piping questions

2006-08-25 Thread John Cortland Morgan \(ZG/ETK\)
Hi,

  Anyone know of a good online reference/tutorial for perl/Tk,
especially in
area of layouts (pack/grid/?)? Can't seem to get things lined up as I'd
like.

  Also, anyone know how to (easily) get a script to act more like a
pipe,
ie: like Unix cat, head, etc... What I would like to be able to do is:

cat filename | myscript.pl 

  or 

myscript.pl -f filename   # I use
Getopt::Long on most of my scripts

  or even

cat filename | myscript.pl -debug

I've written a not so elegent subroutine to do it because I couldn't
find a module
which I could get to do it, or I didn't know how to use the module
properly.
Surely there is one (module) out there already that does this?

Thanks.

John


Re: changing selected values in optionmenus in perl tk

2005-03-17 Thread Offer Kaye
On Thu, 17 Mar 2005 12:56:33 -0500, BJ <[EMAIL PROTECTED]> wrote:
> Is it possible to change the selected value through software and have
> the results change on the screen? A very simple example would be if I
> had a form with optionmenu's that I was using for data entry, and I
> wanted to reset all the optionmenu's to their default value after the
> "submit" button is pressed. Is there a way that this can be done? Does
> anyone have a link to a good tutorial? The oreilly book on perl tk
> doesnt discuss this. Also, along the same path, does anyone have an
> exampke or a suggestion as to how I could have the options in one menu
> depend on the choice made in another? Thank you very much for your help.
> I tried to read teh manuals, but couldnt find what I was looking to do. ~BJ
> 

It sounds like you need to learn about callbacks and how to use them.
Basically, they are subroutines that you bind a widget to be "called
back" when an event that is related to that widget happens (e.g. a
button being pressed).
Since you have the Oreilly book, you should be fine - just start
reading at the beginning, everything you need to know is covered
there.
Meanwhile I took the example from the Tk::Optionmenu pod page
(http://search.cpan.org/dist/Tk/pod/Optionmenu.pod) and modified it by
adding a button that resets the option menu in the example. Hopefully
this will help you get started:
### begin code 
use Tk;
my $mw = MainWindow->new();

my ($var, $tvar);
my $opt = $mw->Optionmenu(
   -options => [[jan=>1], [feb=>2], [mar=>3], [apr=>4]],
   -command => sub { print "got: ", shift, "\n" },
   -variable => \$var,
   -textvariable => \$tvar
  )->pack;

my $f = $mw->Frame(-relief=>'groove', -borderwidth => 2)->pack;
$f->Label(-textvariable=>\$tvar)->pack(-side => 'left');
$f->Label(-text => " -> ")->pack(-side => 'left');
$f->Label(-textvariable=>\$var)->pack(-side => 'left');

$mw->Button(-text=>'Done Selecting!', 
  -command=>sub{
 $var = 1; $tvar = "jan";
 $opt->configure(
   -variable => \$var,
   -textvariable => \$tvar
 );
  })->pack;
$mw->Button(-text=>'Exit', -command=>sub{$mw->destroy})->pack;

MainLoop;
### end code 

Hope this helps,
-- 
Offer Kaye

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




changing selected values in optionmenus in perl tk

2005-03-17 Thread BJ
Is it possible to change the selected value through software and have 
the results change on the screen? A very simple example would be if I 
had a form with optionmenu's that I was using for data entry, and I 
wanted to reset all the optionmenu's to their default value after the 
"submit" button is pressed. Is there a way that this can be done? Does 
anyone have a link to a good tutorial? The oreilly book on perl tk 
doesnt discuss this. Also, along the same path, does anyone have an 
exampke or a suggestion as to how I could have the options in one menu 
depend on the choice made in another? Thank you very much for your help. 
I tried to read teh manuals, but couldnt find what I was looking to do. ~BJ

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Re: perl/tk

2005-01-22 Thread John W. Krahn
harry bennett wrote:
looking for a mailing list particular to perl/Tk
http://lists.perl.org/showlist.cgi?name=ptk
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



perl/tk

2005-01-22 Thread harry bennett
looking for a mailing list particular to perl/Tk


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Perl/TK Development Suite/Gui

2004-10-14 Thread Bastian Angerstein
Hi,
I am looking for a free (graphic) development tool for building perl/tk
applications.
It should run under AIX and/or Linux.

If anybody knows a good tool, with something like a tk gui-painter tell me,
please.

Thanks Bastian


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: entering text in perl/tk

2004-09-20 Thread Raymond Raj

Hi,
go for any perl/tk manual, unfortunate I don't know more about perl/tk.
once i had time to check that "widget"  demos so only i mentioned that
examples...anyway maybe some one else from this group can help!

Raymond






-Original Message-
From: N, Guruguhan (GEAE, Foreign National, EACOE)
[mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 6:19 PM
To: Raymond Raj; [EMAIL PROTECTED]
Subject: RE: entering text in perl/tk


Hi Raj,
   I don't have the Active State perl widget.bat. If I don't have
this what else can be the option?

Guruguhan

-Original Message-
From: Raymond Raj [mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 5:59 PM
To: N, Guruguhan (GEAE, Foreign National, EACOE); [EMAIL PROTECTED]
Subject: RE: entering text in perl/tk



Hi,


did try widget.bat it's contain lot of example for perl/tk ..if you have
Active State perl widget.bat comes with that version





-Original Message-
From: N, Guruguhan (GEAE, Foreign National, EACOE)
[mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 5:50 PM
To: [EMAIL PROTECTED]
Subject: entering text in perl/tk


Hi All,
   I would like to know what widget I should use in order to allow
the user to enter the text ( may be several lines ) in it and store that
entered text in a file in Perl/Tk? I tried with Text Widgets, but failed.
Any help would be appreciated.

TIA
Guruguhan


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: entering text in perl/tk

2004-09-20 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi Raj,
   I don't have the Active State perl widget.bat. If I don't have this what 
else can be the option?

Guruguhan

-Original Message-
From: Raymond Raj [mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 5:59 PM
To: N, Guruguhan (GEAE, Foreign National, EACOE); [EMAIL PROTECTED]
Subject: RE: entering text in perl/tk



Hi,


did try widget.bat it's contain lot of example for perl/tk ..if you have
Active State perl widget.bat comes with that version





-Original Message-
From: N, Guruguhan (GEAE, Foreign National, EACOE)
[mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 5:50 PM
To: [EMAIL PROTECTED]
Subject: entering text in perl/tk


Hi All,
   I would like to know what widget I should use in order to allow
the user to enter the text ( may be several lines ) in it and store that
entered text in a file in Perl/Tk? I tried with Text Widgets, but failed.
Any help would be appreciated.

TIA
Guruguhan


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: entering text in perl/tk

2004-09-20 Thread Raymond Raj

Hi,


did try widget.bat it's contain lot of example for perl/tk ..if you have
Active State perl widget.bat comes with that version





-Original Message-
From: N, Guruguhan (GEAE, Foreign National, EACOE)
[mailto:[EMAIL PROTECTED]
Sent: Monday, September 20, 2004 5:50 PM
To: [EMAIL PROTECTED]
Subject: entering text in perl/tk


Hi All,
   I would like to know what widget I should use in order to allow
the user to enter the text ( may be several lines ) in it and store that
entered text in a file in Perl/Tk? I tried with Text Widgets, but failed.
Any help would be appreciated.

TIA
Guruguhan


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




entering text in perl/tk

2004-09-20 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi All,
   I would like to know what widget I should use in order to allow the user to 
enter the text ( may be several lines ) in it and store that entered text in a file in 
Perl/Tk? I tried with Text Widgets, but failed. Any help would be appreciated. 

TIA
Guruguhan


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




[Solved]Re: Help a newbie to pick best version of Linux for Perl and perl/TK.

2004-07-18 Thread Marco Perl
thank you so much.
regards,
Marco.


--- Harald Richard Ashburner <[EMAIL PROTECTED]>
wrote:
> Marco Perl said:
> >
> >Hi, Could you tell me what version of Linux is the
> most stable and 
> >
> >with most lib modules to do pearl and perl/TK?
> >
> Hi Marco,
> Hmmm, how to start a flame war :)
> 
> 
> I use debian myself, which has a reputation for
> stability. So what. They're all good. I reccomend
> using whatever distribution your friends are using
> or is popular at your friendly local linux users
> group.
> 
> knoppix http://www.knoppix.org boots of a cd so you
> can play with it
> while you make up your mind if it's for you without
> messing around with
> hard disk reformatting until you are sure.
> 
> 
> 
> As far as I am aware, all current distributions come
> with Perl 5.8+ as
> standard, cpan does the rest for you, including TK.
> 
> 
> -- 
> Kind regards,
> Hal Ashburner
> 
> -- 
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> <http://learn.perl.org/>
> <http://learn.perl.org/first-response>
> 
> 
> 


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Help a newbie to pick best version of Linux for Perl and perl/TK.

2004-07-14 Thread Harald Richard Ashburner
Marco Perl said:
>
>Hi, Could you tell me what version of Linux is the most stable and 
>
>with most lib modules to do pearl and perl/TK?
>
Hi Marco,
Hmmm, how to start a flame war :)


I use debian myself, which has a reputation for stability. So what. They're all good. 
I reccomend using whatever distribution your friends are using or is popular at your 
friendly local linux users group.

knoppix http://www.knoppix.org boots of a cd so you can play with it
while you make up your mind if it's for you without messing around with
hard disk reformatting until you are sure.



As far as I am aware, all current distributions come with Perl 5.8+ as
standard, cpan does the rest for you, including TK.


-- 
Kind regards,
Hal Ashburner

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: Help a newbie to pick best version of Linux for Perl and perl /TK.

2004-07-14 Thread Bob Showalter
Marco Perl wrote:
> Hi, Could you tell me what version of Linux is the most stable and
> with most lib modules to do pearl and perl/TK?

http:/www.freebsd.org

I couldn't resist...  :~)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Help a newbie to pick best version of Linux for Perl and perl/TK.

2004-07-14 Thread Andrew Gaffney
Marco Perl wrote:
Hi, Could you tell me what version of Linux is the most stable and 

with most lib modules to do pearl and perl/TK?
I really appreciate your experience.
Marco.
What exactly are you talking about? Almost all Linux distributions are "stable" 
and come with Perl. Usually, the version of the Linux kernel won't affect 
anything in Perl or Perl/Tk, either.

--
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Help a newbie to pick best version of Linux for Perl and perl/TK.

2004-07-14 Thread Marco Perl

Hi, Could you tell me what version of Linux is the most stable and 

with most lib modules to do pearl and perl/TK?

I really appreciate your experience.
Marco.


-
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!

Re: how do you run the debuger for perl/TK in Windows-2000

2004-07-12 Thread William . Ampeh




Simply wrap it around a batch file with a pause at the end.

That is:

@echo off
path\to\my\script
echo .
echo .
echo .  - D O N E -
echo .
echo .
pause

__

William Ampeh (x3939)
Federal Reserve Board


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




[SOLVED] RE: how do you run the debuger for perl/TK in Windows-2000

2004-07-12 Thread Marco Perl
my first email's subject line was not
good/descriptive.
so I tried a better subject line on my second email.
in any rate, thanks for traffic update/info. I am new
on this and I appreciate your concern.
regards,
Marco.



--- Tim Johnson <[EMAIL PROTECTED]> wrote:
> Please don't send the same question to the list
> twice in a row.  The truth is there aren't many
> people answering questions on a Sunday night (US),
> but re-sending the question doesn't increase your
> chances of having your question answered, but some
> people really get irked by the extra traffic on an
> already congested list.
>  
> In any case, someone gave a good answer to your
> original question already.
> 
>   -Original Message- 
>   From: Marco Perl [mailto:[EMAIL PROTECTED] 
>   Sent: Sun 7/11/2004 11:58 PM 
>   To: [EMAIL PROTECTED];
> [EMAIL PROTECTED] 
>   Cc: 
>   Subject: how do you run the debuger for perl/TK in
> Windows-2000
>   
>   
> 
>   Greetings,
>   I developed a perl/TK script in Win-2000
> environment.
>   when I run it the DOS-screen pops up and displays
> my
>   program errors. but this screen closes so fast that
>   its impossible to read the error. so, how do I
> debug
>   my
>   perl.ptk script or how do I slow down the
> DOS-screen
>   to read the errors?
>   thanks so much,
>   regards,
>   Marco.
>   
>   
>  
>   __
>   Do you Yahoo!?
>   New and Improved Yahoo! Mail - Send 10MB messages!
>   http://promotions.yahoo.com/new_mail
>   
>   --
>   To unsubscribe, e-mail:
> [EMAIL PROTECTED]
>   For additional commands, e-mail:
> [EMAIL PROTECTED]
>   <http://learn.perl.org/>
> <http://learn.perl.org/first-response>
>   
>   
>   
> 
> 




__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




[SOLVED] RE: Could you please help with a PERL/TK question.

2004-07-12 Thread Marco Perl
adding ; did not work, but running it from cmd
shell did. thank you so much.
regards,
Marco.


--- Toby Stuart <[EMAIL PROTECTED]> wrote:
> 
> 
> > -Original Message-
> > From: Marco Perl [mailto:[EMAIL PROTECTED]
> > Sent: Monday, 12 July 2004 4:19 PM
> > To: ; [EMAIL PROTECTED]
> > Subject: Could you please help with a PERL/TK
> question.
> > 
> > 
> > 
> > Hi, I developed a perl/TK script in Win-2000
> > environment.
> > when I run it the DOS-screen pops up and displays
> my 
> > program errors. but this screen closes so fast
> that
> > its 
> > impossible to read the error. so, how do I debug
> my 
> > perl.ptk script or how do I slow down the
> DOS-screen
> > to read the errors?
> > thanks so much,
> > regards,
> > Marco.
> > 
> > 
> 
> Are you launching your Tk script via a double-click
> of the filename in
> windows explorer/desktop etc?  If so, the script
> will run and when finished
> (or errors occurred) the cmd shell window will
> disappear, this is normal
> behaviour.
> 
> Either add a the line: ';' (without quotes)
> to the end of your
> program or run the script directly from the cmd
> shell.
> 
> To run the script directly from cmd shell ie. click
> "Start" and then select
> "Run" and type "cmd".  The cmd shell appears.  Then
> type: perl
> path\to\my\script.pl
> 
> 
> 
> 





__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: how do you run the debuger for perl/TK in Windows-2000

2004-07-12 Thread Tim Johnson
Please don't send the same question to the list twice in a row.  The truth is there 
aren't many people answering questions on a Sunday night (US), but re-sending the 
question doesn't increase your chances of having your question answered, but some 
people really get irked by the extra traffic on an already congested list.
 
In any case, someone gave a good answer to your original question already.

-Original Message- 
From: Marco Perl [mailto:[EMAIL PROTECTED] 
Sent: Sun 7/11/2004 11:58 PM 
To: [EMAIL PROTECTED]; [EMAIL PROTECTED] 
Cc: 
Subject: how do you run the debuger for perl/TK in Windows-2000



Greetings,
    I developed a perl/TK script in Win-2000 environment.
when I run it the DOS-screen pops up and displays my
program errors. but this screen closes so fast that
its impossible to read the error. so, how do I debug
my
perl.ptk script or how do I slow down the DOS-screen
to read the errors?
thanks so much,
regards,
Marco.


   
__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>






Launching scripts via command prompt [WAS RE: Could you please help with a PERL/TK question.]

2004-07-12 Thread Tim Johnson
 
Just one quick note:  I've seen a lot of people say that this is the way to run a 
script from the command-line, but any script that you can run by double-clicking 
should also be able to be run by just typing in the name of the script at the 
command-line (provided you are in the same directory as the script).
 
The only time you should have to use the syntax "perl path\to\script.pl" is if you 
don't have the file association set up correctly, for example if you decided to 
compile your own Perl distribution instead of using ActivePerl or another pre-packaged 
Win32 distribution.  But if that's the case, then you won't be able to double-click 
anyway.
 
-Original Message- 
From: Toby Stuart [mailto:[EMAIL PROTECTED] 
Sent: Sun 7/11/2004 11:34 PM 
To: 'Marco Perl' 
Cc: '[EMAIL PROTECTED]' 
Subject: RE: Could you please help with a PERL/TK question.





To run the script directly from cmd shell ie. click "Start" and then select
"Run" and type "cmd".  The cmd shell appears.  Then type: perl
path\to\my\script.pl




how do you run the debuger for perl/TK in Windows-2000

2004-07-11 Thread Marco Perl
Greetings,
I developed a perl/TK script in Win-2000 environment.
when I run it the DOS-screen pops up and displays my
program errors. but this screen closes so fast that
its impossible to read the error. so, how do I debug
my
perl.ptk script or how do I slow down the DOS-screen
to read the errors?
thanks so much,
regards,
Marco.



__
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: Could you please help with a PERL/TK question.

2004-07-11 Thread Toby Stuart


> -Original Message-
> From: Marco Perl [mailto:[EMAIL PROTECTED]
> Sent: Monday, 12 July 2004 4:19 PM
> To: ; [EMAIL PROTECTED]
> Subject: Could you please help with a PERL/TK question.
> 
> 
> 
> Hi, I developed a perl/TK script in Win-2000
> environment.
> when I run it the DOS-screen pops up and displays my 
> program errors. but this screen closes so fast that
> its 
> impossible to read the error. so, how do I debug my 
> perl.ptk script or how do I slow down the DOS-screen
> to read the errors?
> thanks so much,
> regards,
> Marco.
> 
> 

Are you launching your Tk script via a double-click of the filename in
windows explorer/desktop etc?  If so, the script will run and when finished
(or errors occurred) the cmd shell window will disappear, this is normal
behaviour.

Either add a the line: ';' (without quotes) to the end of your
program or run the script directly from the cmd shell.

To run the script directly from cmd shell ie. click "Start" and then select
"Run" and type "cmd".  The cmd shell appears.  Then type: perl
path\to\my\script.pl




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Could you please help with a PERL/TK question.

2004-07-11 Thread Marco Perl

Hi, I developed a perl/TK script in Win-2000
environment.
when I run it the DOS-screen pops up and displays my 
program errors. but this screen closes so fast that
its 
impossible to read the error. so, how do I debug my 
perl.ptk script or how do I slow down the DOS-screen
to read the errors?
thanks so much,
regards,
Marco.



__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Perl/TK hang on windows ?

2004-05-28 Thread Peter
Hi,

I have a Perl/Tk program that seems to hang in the following way. I have
narrowed it down to
the following situation, so it is not the real code I have. In a subroutine
that handles button
click event, I have an infinite loop with a sleep 60 in it and nothing else.
When this button is
clicked, the entire Perl/Tk screen freezes - I can not bring it in or out of
focus by clicking on
it, I can not move the screen. This infinite loop is try to simulate the
situation when the program
is waiting for a response message from a remote server that may take some
time to come back.

I am using Active State Perl on Win 2000. Any help/comments would be
appreciated.

Thanks.

Peter



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Perl/Tk Scale replacement

2004-05-06 Thread Chris
Greetings,

Im writing a simple audio player that is built into an application im 
developing, and need to find a control that would be suitable for a "Seek 
Bar". Right now im using the Scale widget, and obviously its not what I would 
want to use in a production enviroment since it shows all the numbers from 
start to finish of the size of the scale underneath it.

Is there anyway to either remove those numbers ONLY below, or is there a 
better way suited for what im doing?

Thanks!
-c

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Perl/Tk info needed

2004-04-29 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi All,
  Can someone tell me where I can find information on how to do scatter 
plotting of data stored in a file using Perl/Tk? Is there any freeware available for 
doing the same? Any help in this regard is solicited. 

Thanks
Regards
Guruguhan


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




combobox in perl/tk

2004-04-22 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi All,
  Is there anything equivalent of combobox in Tcl/Tk in Perl/Tk?
Thanks
Regards
Guruguhan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




plotting in Perl/Tk

2004-04-19 Thread N, Guruguhan \(GEAE, Foreign National, EACOE\)
Hi All,
  I am trying to develop a plotting utility in Perl/Tk for scatter plotting of 
data stored in a file. I would like to know is there any standard codes available for 
this? Any help in this regard is solicited.   

Thanks
Regards
Guruguhan


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Perl/TK

2004-04-08 Thread Randal L. Schwartz
>>>>> "WilliamGunther" == WilliamGunther  <[EMAIL PROTECTED]> writes:

WilliamGunther> Two books. Learning Perl/Tk and Mastering Perl/Tk. I think Mastering 
Perl/Tk 
WilliamGunther> is really all you need.

Learning Perl/Tk is also out of print, having been entirely subsumed
by Mastering Perl/Tk.

>> 2./  Can anyone recommend a class that will help lower my learning curve
>> (specifically on Perl/Tk).  As far as Perl goes, I can say I feel decently
>> comfortable detecting codes written in Perl.  Perl/Tk, however, is a
>> different ball game.

Well, I've got the beginnings of P-Tk curriculum being developed.  The
problem is getting 10 to 20 people in the same room wanting to learn
the same things. :) If you can help me there (like you have 10-20
people in your company), I'll be happy to respond kindly.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Perl/TK

2004-04-07 Thread Smoot Carl-Mitchell
On Wed, 7 Apr 2004 13:31:21 EDT
[EMAIL PROTECTED] wrote:

> Two books. Learning Perl/Tk and Mastering Perl/Tk. I think Mastering
> Perl/Tk is really all you need. There's also a pocket reference that I
> have and it is quite helpful because Tk is a pretty extensive module.
> But, really, like Perl, you don't need to buy books to learn. There is
> a lot of docmentation just with pods. A LOT. And because Perl/Tk is so
> extensive and dynamic, you won't learn all you can if you never looked
> at them. Navigate the pods (For something like Tk, you would be best
> with perldoc.com) and check out the FAQs
> (http://www.lns.cornell.edu/~pvhp/ptk/ptkFAQ.html) and go from there.

I concur with this assessment. Also the Perl/Tk module comes with some
example programs which are also very useful learning tools.

-- 
Smoot Carl-Mitchell
Systems/Network Architect
email: [EMAIL PROTECTED]
cell: +1 602 421 9005
home: +1 480 922 7313

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Perl/TK

2004-04-07 Thread WilliamGunther
>Hello,
>
>I am taking a look at some Ptk codes, and I think I need a to do some
>reading.  So my question is:
>
>1./ What is a good source or reference materials/books on Perl/Tk?

Two books. Learning Perl/Tk and Mastering Perl/Tk. I think Mastering Perl/Tk 
is really all you need. There's also a pocket reference that I have and it is 
quite helpful because Tk is a pretty extensive module. But, really, like Perl, 
you don't need to buy books to learn. There is a lot of docmentation just 
with pods. A LOT. And because Perl/Tk is so extensive and dynamic, you won't 
learn all you can if you never looked at them. Navigate the pods (For something 
like Tk, you would be best with perldoc.com) and check out the FAQs 
(http://www.lns.cornell.edu/~pvhp/ptk/ptkFAQ.html) and go from there.

>2./  Can anyone recommend a class that will help lower my learning curve
>(specifically on Perl/Tk).  As far as Perl goes, I can say I feel decently
>comfortable detecting codes written in Perl.  Perl/Tk, however, is a
>different ball game.

Honestly, if you just get Learning Perl/Tk it's very simple to pick up. 
Sometimes its easy to get lost when you start Perl/Tk because its looked at as 
something other than what it is: a Perl Module. You shouldn't have too much 
trouble if you have command of perl in making GUIs. I wouldn't take a class just for 
the Tk module. 

>
>Thank you.
>
>


-will
(the above message is double rot13 encoded for security reasons)

Most Useful Perl Modules
-strict
-warnings
-Devel::DProf
-Benchmark
-B::Deparse
-Data::Dumper
-Clone (a Godsend)
-Perl::Tidy
-Beautifier

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Perl/TK

2004-04-07 Thread William.Ampeh




Hello,

I am taking a look at some Ptk codes, and I think I need a to do some
reading.  So my question is:

1./ What is a good source or reference materials/books on Perl/Tk?

2./  Can anyone recommend a class that will help lower my learning curve
(specifically on Perl/Tk).  As far as Perl goes, I can say I feel decently
comfortable detecting codes written in Perl.  Perl/Tk, however, is a
different ball game.


Thank you.

__

William Ampeh (x3939)
Federal Reserve Board


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Perl / Tk Gui Toolkit?

2004-03-07 Thread Robert
John wrote:
Do you know any major malling list or forum concerning the Perl/Tk ?

- Original Message - 
From: "Benjamin Walkenhorst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 25, 2004 3:04 PM
Subject: Re: Perl / Tk Gui Toolkit?



Hello,

I recently started learning Perl/Tk. My primary system is FreeBSD 5.2,
on which Perl/Tk works fine. At work, I have to use windows,
unfortunately, but it works fine, too, under Windows. I don't see why it
should not work with Solaris.
So far, I like Perl/Tk very much. I did not have any prior experience in
writing graphical interfaces, but Tk makes this *very* easy. 
There's lots of tutorials available online. If you want a printed book,
"Mastering Perl/Tk" is available from O'Reilly. In my opinion it's very
good. Perl/Tk also comes with good documentation (perldoc Tk / perldoc
Tk::).

Tk is part of ActivePerl by default, under windows. Under Solaris ...
uh, I don't know, but Perl is quite probably installed along with the
system, so you just check CPAN for Perl/Tk. 

Otherwise, I briefly touched GtkPerl, but I did not like it as much. Tk
is very intuitive to use, in my view, plus it's probably most widely
available. I don't think many windows-systems have a Gtk-library
installed... 
(And, of course, I like the minimalistic, Unix-like look I get under...
well, Unix-systems. It's  a shame in my view that Tk now uses the native
windows-look under Win32, but that's a matter of taste.)

Kind regards,

Benjamin

--
If you want to know what god thinks of money, just look at the people
he gave it to.
   -- Dorothy Parker
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



comp.lang.perl.tk (point your newsreader there or use GOOGLE groups).

HTH

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



JPG images problem in Perl/Tk

2004-02-26 Thread John
I downloaded bvia ppm the Tk::JPEG (active state) but i recieved the following error.


Tk::JPEG object version 800.023 does not match $Tk::JPEG::XS_VERSION 800.024 at
C:/Perl/lib/DynaLoader.pm line 225,  line 164.
Compilation failed in require at gui.pl line 11,  line 164.

What can i do now?

Re: JPG images problem in Perl/Tk

2004-02-26 Thread Andrew Gaffney
John wrote:
I downloaded bvia ppm the Tk::JPEG (active state) but i recieved the following error.

Tk::JPEG object version 800.023 does not match $Tk::JPEG::XS_VERSION 800.024 at
C:/Perl/lib/DynaLoader.pm line 225,  line 164.
Compilation failed in require at gui.pl line 11,  line 164.
What can i do now?
Umm, get TK::JPEG version 800.024?

--
Andrew Gaffney
Network Administrator
Skyline Aeronautics, LLC.
636-357-1548
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 



Re: JPG images problem in Perl/Tk

2004-02-26 Thread John
 How can i do that?
 
 i use win32 perl
 
 
> - Original Message - 
> From: "Andrew Gaffney" <[EMAIL PROTECTED]>
> To: "John" <[EMAIL PROTECTED]>
> Sent: Thursday, February 26, 2004 6:03 PM
> Subject: Re: JPG images problem in Perl/Tk
> 
> 
> > John wrote:
> > > I downloaded bvia ppm the Tk::JPEG (active state) but i recieved the
> following error.
> > >
> > >
> > > Tk::JPEG object version 800.023 does not match $Tk::JPEG::XS_VERSION
> 800.024 at
> > > C:/Perl/lib/DynaLoader.pm line 225,  line 164.
> > > Compilation failed in require at gui.pl line 11,  line 164.
> > >
> > > What can i do now?
> >
> > Umm, get TK::JPEG version 800.024?
> >
> > -- 
> > Andrew Gaffney
> > Network Administrator
> > Skyline Aeronautics, LLC.
> > 636-357-1548
> >
> >
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




RE: Perl / Tk Gui Toolkit?

2004-02-25 Thread NYIMI Jose (BMB)
Search tk from
http://lists.perl.org

José.


-Original Message-
From: John [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, February 25, 2004 2:29 PM
To: [EMAIL PROTECTED]
Subject: Re: Perl / Tk Gui Toolkit?


Do you know any major malling list or forum concerning the Perl/Tk ?


- Original Message - 
From: "Benjamin Walkenhorst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 25, 2004 3:04 PM
Subject: Re: Perl / Tk Gui Toolkit?


> Hello,
> 
> I recently started learning Perl/Tk. My primary system is FreeBSD 5.2, 
> on which Perl/Tk works fine. At work, I have to use windows, 
> unfortunately, but it works fine, too, under Windows. I don't see why 
> it should not work with Solaris.
> 
> So far, I like Perl/Tk very much. I did not have any prior experience 
> in writing graphical interfaces, but Tk makes this *very* easy. 
> There's lots of tutorials available online. If you want a printed 
> book, "Mastering Perl/Tk" is available from O'Reilly. In my opinion 
> it's very good. Perl/Tk also comes with good documentation (perldoc Tk 
> / perldoc Tk::).
> 
> Tk is part of ActivePerl by default, under windows. Under Solaris ... 
> uh, I don't know, but Perl is quite probably installed along with the 
> system, so you just check CPAN for Perl/Tk.
> 
> Otherwise, I briefly touched GtkPerl, but I did not like it as much. 
> Tk is very intuitive to use, in my view, plus it's probably most 
> widely available. I don't think many windows-systems have a 
> Gtk-library installed... (And, of course, I like the minimalistic, 
> Unix-like look I get under... well, Unix-systems. It's  a shame in my 
> view that Tk now uses the native windows-look under Win32, but that's 
> a matter of taste.)
> 
> Kind regards,
> 
> Benjamin
> 
> --
> If you want to know what god thinks of money, just look at the people
> he gave it to.
> -- Dorothy Parker
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> 
<http://learn.perl.org/first-response>




 DISCLAIMER 

"This e-mail and any attachment thereto may contain information which is confidential 
and/or protected by intellectual property rights and are intended for the sole use of 
the recipient(s) named above. 
Any use of the information contained herein (including, but not limited to, total or 
partial reproduction, communication or distribution in any form) by other persons than 
the designated recipient(s) is prohibited. 
If you have received this e-mail in error, please notify the sender either by 
telephone or by e-mail and delete the material from any computer".

Thank you for your cooperation.

For further information about Proximus mobile phone services please see our website at 
http://www.proximus.be or refer to any Proximus agent.


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Perl / Tk Gui Toolkit?

2004-02-25 Thread John
Do you know any major malling list or forum concerning the Perl/Tk ?


- Original Message - 
From: "Benjamin Walkenhorst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, February 25, 2004 3:04 PM
Subject: Re: Perl / Tk Gui Toolkit?


> Hello,
> 
> I recently started learning Perl/Tk. My primary system is FreeBSD 5.2,
> on which Perl/Tk works fine. At work, I have to use windows,
> unfortunately, but it works fine, too, under Windows. I don't see why it
> should not work with Solaris.
> 
> So far, I like Perl/Tk very much. I did not have any prior experience in
> writing graphical interfaces, but Tk makes this *very* easy. 
> There's lots of tutorials available online. If you want a printed book,
> "Mastering Perl/Tk" is available from O'Reilly. In my opinion it's very
> good. Perl/Tk also comes with good documentation (perldoc Tk / perldoc
> Tk::).
> 
> Tk is part of ActivePerl by default, under windows. Under Solaris ...
> uh, I don't know, but Perl is quite probably installed along with the
> system, so you just check CPAN for Perl/Tk. 
> 
> Otherwise, I briefly touched GtkPerl, but I did not like it as much. Tk
> is very intuitive to use, in my view, plus it's probably most widely
> available. I don't think many windows-systems have a Gtk-library
> installed... 
> (And, of course, I like the minimalistic, Unix-like look I get under...
> well, Unix-systems. It's  a shame in my view that Tk now uses the native
> windows-look under Win32, but that's a matter of taste.)
> 
> Kind regards,
> 
> Benjamin
> 
> -- 
> If you want to know what god thinks of money, just look at the people
> he gave it to.
> -- Dorothy Parker
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
> 
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Perl / Tk Gui Toolkit?

2004-02-25 Thread Benjamin Walkenhorst
Hello,

I recently started learning Perl/Tk. My primary system is FreeBSD 5.2,
on which Perl/Tk works fine. At work, I have to use windows,
unfortunately, but it works fine, too, under Windows. I don't see why it
should not work with Solaris.

So far, I like Perl/Tk very much. I did not have any prior experience in
writing graphical interfaces, but Tk makes this *very* easy. 
There's lots of tutorials available online. If you want a printed book,
"Mastering Perl/Tk" is available from O'Reilly. In my opinion it's very
good. Perl/Tk also comes with good documentation (perldoc Tk / perldoc
Tk::).

Tk is part of ActivePerl by default, under windows. Under Solaris ...
uh, I don't know, but Perl is quite probably installed along with the
system, so you just check CPAN for Perl/Tk. 

Otherwise, I briefly touched GtkPerl, but I did not like it as much. Tk
is very intuitive to use, in my view, plus it's probably most widely
available. I don't think many windows-systems have a Gtk-library
installed... 
(And, of course, I like the minimalistic, Unix-like look I get under...
well, Unix-systems. It's  a shame in my view that Tk now uses the native
windows-look under Win32, but that's a matter of taste.)

Kind regards,

Benjamin

-- 
If you want to know what god thinks of money, just look at the people
he gave it to.
-- Dorothy Parker

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Perl / Tk Gui Toolkit?

2004-02-25 Thread Bastian Angerstein

Hi

has anybody expirience with GUI Toolkit for Perl/Kit?

Which would you recommend for Solaris or Windows? 

Thanks

Bastian

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-02-14 Thread Mike Flannigan

Ahhh.  Not comparing apples to apples.  That does make
a difference.

I need to get me a good Tk book and learn it proper, heh?


Mike


> Mike,
>
> That is because you are mixing threads.  You pggybacked your issue on a thread 
> initiated by
> Vinesh Vargese, concerning the Tk::Text widget, as specified in the title bar.  The 
> sample
> code you tried had do with getting standard output redirected to a Tk widget, though
> Zentara chose a Listbox rather than a Text widget to display the text.  The Listbox 
> widget
> does not have built-in copy-and-paste functionality.  Such functionality would be 
> much more
> dificult to define in a generic sense for a listbox.
>
> This is actualy the question I posed at the end of my post.  I corrected your 
> top-posting
> above so you could see in context.  No, this is not a Text widget.  I think this is 
> by
> design.  Zentara provided sample code to demonstrate the difference between Tk 
> display text
> and standard output.  I don't think he had any intention of handing anyone a 
> completed
> assignment.
>
> A simpler example, which does not deal with the original question, but which does 
> show the
> functionality you are interested in:
>
> Greetings! E:\d_drive\perlStuff>perl -w
> use Tk;
>
> my $win = MainWindow->new(-title => 'This Text Copies Right');
> my $text = $win->Text->pack(-expand => 'both');
> MainLoop;
> ^Z
>
> Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-02-13 Thread R. Joseph Newton
Mike Flannigan wrote:

> I> I think something is going wrong with your highlighting routine.  Or perhaps this 
> is
> > ot a Text widget?  If left alone, the Text widget will offer full copy-and-paste
> > functionality.
> >
>
> f I right click on the title bar, it gives "move", "size",
> "minimize", "maximize", "close".  If I right click anywhere else,
> it doesn't do anything - produces no box.  I don't recall
> hacking anything to do with that, but perhaps I did.
>
> Mike

Mike,

That is because you are mixing threads.  You pggybacked your issue on a thread 
initiated by
Vinesh Vargese, concerning the Tk::Text widget, as specified in the title bar.  The 
sample
code you tried had do with getting standard output redirected to a Tk widget, though
Zentara chose a Listbox rather than a Text widget to display the text.  The Listbox 
widget
does not have built-in copy-and-paste functionality.  Such functionality would be much 
more
dificult to define in a generic sense for a listbox.

This is actualy the question I posed at the end of my post.  I corrected your 
top-posting
above so you could see in context.  No, this is not a Text widget.  I think this is by
design.  Zentara provided sample code to demonstrate the difference between Tk display 
text
and standard output.  I don't think he had any intention of handing anyone a completed
assignment.

A simpler example, which does not deal with the original question, but which does show 
the
functionality you are interested in:

Greetings! E:\d_drive\perlStuff>perl -w
use Tk;

my $win = MainWindow->new(-title => 'This Text Copies Right');
my $text = $win->Text->pack(-expand => 'both');
MainLoop;
^Z

Joseph




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-02-13 Thread Mike Flannigan

If I right click on the title bar, it gives "move", "size",
"minimize", "maximize", "close".  If I right click anywhere else,
it doesn't do anything - produces no box.  I don't recall
hacking anything to do with that, but perhaps I did.


Mike


> Ah, but right clicking on the Text widget will--unless you have hacked the selection
> activities.
> If so, well--*Don't do that*--at least not until you have checked the unhacked
> functionality of the widget.  Tk::Text widgets have built-in copy-and-paste
> functionality.  If you manipualte the selection variables, though, you may be
> generating side effects that disable this functionality.
>
> Okay.  I just checked it out.  I brought up a project containing a Tk::Text widget,
> whose editing functions I had done nothing with.  Highlighted one phrase,
> right-clicked and selected Copy.  Pasted to Notepad from the clipboard, and got the
> same phrase.  Then I went down a line or two, selected another passage, used Ctl-c to
> copied, and again the pasted text showed a successful copy.
>
> I think something is going wrong with your highlighting routine.  Or perhaps this is
> ot a Text widget?  If left alone, the Text widget will offer full copy-and-paste
> functionality.
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-02-11 Thread R. Joseph Newton
Mike Flannigan wrote:

> In any case, hitting ctrl C does not copy anything to the
> clipboard, and you cannot highlight just part of a line
> of text.

Ah, but right clicking on the Text widget will--unless you have hacked the selection
activities.
If so, well--*Don't do that*--at least not until you have checked the unhacked
functionality of the widget.  Tk::Text widgets have built-in copy-and-paste
functionality.  If you manipualte the selection variables, though, you may be
generating side effects that disable this functionality.

Okay.  I just checked it out.  I brought up a project containing a Tk::Text widget,
whose editing functions I had done nothing with.  Highlighted one phrase,
right-clicked and selected Copy.  Pasted to Notepad from the clipboard, and got the
same phrase.  Then I went down a line or two, selected another passage, used Ctl-c to
copied, and again the pasted text showed a successful copy.

I think something is going wrong with your highlighting routine.  Or perhaps this is
ot a Text widget?  If left alone, the Text widget will offer full copy-and-paste
functionality.

> > Houston, TX
> >
> > Mike, I think you have a conceptual problem here.
>
> Yeah, my main problem is I'm using Windows.

Nope.  Windows certainly has its share of shortcomings, but they really don't seem to
bear on the issues you are presenting.  The habit of low-level hacking will get you in
even more trouble on Linux.

>  I've been
> trying to get a Linux box set up for quite some time now,
> but it looks like it's going to be quite a bit longer before I
> have it running.

>
> > Seeking STDIN from a GUI
> > widget,
>
> Yeah, I thought you could do that.  I need to study TK quite
> a bit.

Yes.  Tk is a complex, diverse, and somewhat uneven libary.  It is really a ood idea
to read the documentation on each widget you use.  Each widget has its own
characteristics and behaviorSome of them are pretty obvious, some are more subtle.

So I will reiterate:

> > hacking
> > and breaking working file associations, etc.  indicate a bad habit that will
> > hobble your programming
> > efforts if unaddressed.  *Let working systems be*, don't fix what ain't broke.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-02-11 Thread Mike Flannigan


> > I was wondering if you could help me get this script
> > tied to one of my Perl programs on my Win2000 box.
> > After much experimentation, I've changed the line
> > open(C, "./read-own-stdout-piper 2>&1 |") or warn $!;
> > to
> > open(C, "round2.bat 2>&1 |") or warn $!;
> >
> > round2.bat is a DOS batch file with a single line:
> > perl round2.pl# (that is the way I run perl programs)
> >
> > round2.pl has:
> >
> > use strict;
> > use warnings;
> > my $number = 5.6278;
> > my $rounded = sprintf '%.2f', $number;
> > print "$rounded\n";
> > $|++;   # << SHOULD THIS LINE BE HERE?
> >
> > AND IT ALL WORKS!
> >
> > I can't just do
> > open(C, "round2.pl 2>&1 |") or warn $!;
> > because then it just opens round2.pl in my text editor,
>
> > since that is the association I have ".pl" set to.
>
> Why?!?!  Why screw with something that works, unscrewed with, just fine?  The
> asscociations set up
> by the ActivePerl install are the appropriate ones for making Perl run.

Thanks for the response.  Remember, I am using Windows on
this box.  As others have recently pointed out, I need to run
Perl in a command prompt anyway, so it behooves me to
associate ".pl" with my text editor and not the Perl
executable.


> If you
> want associations to your
> preferred editor, then:
> Open Windows Explorer, or the abonminable kindergarten version My Computer
> Click Folder Options on the Tools menu
> Select File types
> Find the PL extension.
> Click the Advanced button.
> Restore the Open association with the perl executable.  The Open action should
> read:
>
> "C:\Perl\bin\perl.exe" "%1" %*
>
> presuming that Perl is installed to the default location for Windows
>
> Create an Edit action tied to your editor.

I don't know what an "Edit action" is, but I am looking
into it.


>
> Changing the primary association is a bad hack, and a bad habit to be in as you
> start learning a programming
> language.
>
> Actually, once you right-click on any registered file type in Win2K, and use the
> Open with... option option to
> select an alternate handler, that handler will thereafter be available on a list
> under the Open with menu item.
>
> In brief, there is no good reason to mess with a working file association
>
> >  I tried
> > open(C, "'perl round2.pl' 2>&1 |") or warn $!;
> > but that didn't work either.
>
> open(C, "perl round2.pl 2>&1 |") or warn $!;

I thought I tried that, but apparently not, because it
works perfectly.  Not too smart on my part.


> or simply:
> open(CHILD, "perl round2.pl | ") or warn "Could not open pipe from child
> process: $!";
>
> >
> > That "Got:" prompt isn't too cool,  but I'm sure I'll
> > learn how to turn that off later.
> >
> > Also, it's unfortunate that copy and paste don't work
> > in that TK box.
>
> If it is a Text widget, copy and paste will indeed work.  Can you provide more
> detail on
> why you think it doesn't?

I changed round2.pl to include "print "Hello World\n";"

Now it's the nice, pretty Tk box with "Got: 5.63" on the
first line and "Got: Hello World" on the 2nd line.  Clicking
on each line alternately highlights the entire line or
unhighlights the entire line with a dark blue line.  You
can have both lines highlighted if you like.

In any case, hitting ctrl C does not copy anything to the
clipboard, and you cannot highlight just part of a line
of text.



> > Anyway, thanks a bunch.  If there are other posts
> > on the NG related to this, I'll see them when I get
> > home.
> >
> > Mike Flannigan
> > Houston, TX
>
> Mike, I think you have a conceptual problem here.

Yeah, my main problem is I'm using Windows.  I've been
trying to get a Linux box set up for quite some time now,
but it looks like it's going to be quite a bit longer before I
have it running.


> Seeking STDIN from a GUI
> widget,

Yeah, I thought you could do that.  I need to study TK quite
a bit.


> hacking
> and breaking working file associations, etc.  indicate a bad habit that will
> hobble your programming
> efforts if unaddressed.  *Let working systems be*, don't fix what ain't broke.
>
> Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-02-10 Thread R. Joseph Newton
Mike Flannigan wrote:

> I was wondering if you could help me get this script
> tied to one of my Perl programs on my Win2000 box.
> After much experimentation, I've changed the line
> open(C, "./read-own-stdout-piper 2>&1 |") or warn $!;
> to
> open(C, "round2.bat 2>&1 |") or warn $!;
>
> round2.bat is a DOS batch file with a single line:
> perl round2.pl# (that is the way I run perl programs)
>
> round2.pl has:
>
> use strict;
> use warnings;
> my $number = 5.6278;
> my $rounded = sprintf '%.2f', $number;
> print "$rounded\n";
> $|++;   # << SHOULD THIS LINE BE HERE?
>
> AND IT ALL WORKS!
>
> I can't just do
> open(C, "round2.pl 2>&1 |") or warn $!;
> because then it just opens round2.pl in my text editor,

> since that is the association I have ".pl" set to.

Why?!?!  Why screw with something that works, unscrewed with, just fine?  The
asscociations set up
by the ActivePerl install are the appropriate ones for making Perl run.  If you
want associations to your
preferred editor, then:
Open Windows Explorer, or the abonminable kindergarten version My Computer
Click Folder Options on the Tools menu
Select File types
Find the PL extension.
Click the Advanced button.
Restore the Open association with the perl executable.  The Open action should
read:

"C:\Perl\bin\perl.exe" "%1" %*

presuming that Perl is installed to the default location for Windows

Create an Edit action tied to your editor.

Changing the primary association is a bad hack, and a bad habit to be in as you
start learning a programming
language.

Actually, once you right-click on any registered file type in Win2K, and use the
Open with... option option to
select an alternate handler, that handler will thereafter be available on a list
under the Open with menu item.

In brief, there is no good reason to mess with a working file association

>  I tried
> open(C, "'perl round2.pl' 2>&1 |") or warn $!;
> but that didn't work either.

open(C, "perl round2.pl 2>&1 |") or warn $!;
or simply:
open(CHILD, "perl round2.pl | ") or warn "Could not open pipe from child
process: $!";

>
> That "Got:" prompt isn't too cool,  but I'm sure I'll
> learn how to turn that off later.
>
> Also, it's unfortunate that copy and paste don't work
> in that TK box.

If it is a Text widget, copy and paste will indeed work.  Can you provide more
detail on
why you think it doesn't?

> Anyway, thanks a bunch.  If there are other posts
> on the NG related to this, I'll see them when I get
> home.
>
> Mike Flannigan
> Houston, TX

Mike, I think you have a conceptual problem here.  Seeking STDIN from a GUI
widget, hacking
and breaking working file associations, etc.  indicate a bad habit that will
hobble your programming
efforts if unaddressed.  *Let working systems be*, don't fix what ain't broke.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-02-10 Thread Mike Flannigan

I tried to send off-list, but the e-mail address did not
work, so I'm posting to the list:



Hey, I was very impressed when this script you provided
ran for me.  All I did is run the first script and it
creates the box nicely.

I don't know much about spawning child processes.  I'm
on vacation and much of my Perl documentation is at
home.

I was wondering if you could help me get this script
tied to one of my Perl programs on my Win2000 box.
After much experimentation, I've changed the line
open(C, "./read-own-stdout-piper 2>&1 |") or warn $!;
to
open(C, "round2.bat 2>&1 |") or warn $!;

round2.bat is a DOS batch file with a single line:
perl round2.pl# (that is the way I run perl programs)

round2.pl has:

use strict;
use warnings;
my $number = 5.6278;
my $rounded = sprintf '%.2f', $number;
print "$rounded\n";
$|++;   # << SHOULD THIS LINE BE HERE?

AND IT ALL WORKS!


I can't just do
open(C, "round2.pl 2>&1 |") or warn $!;
because then it just opens round2.pl in my text editor,
since that is the association I have ".pl" set to.  I tried
open(C, "'perl round2.pl' 2>&1 |") or warn $!;
but that didn't work either.

That "Got:" prompt isn't too cool,  but I'm sure I'll
learn how to turn that off later.

Also, it's unfortunate that copy and paste don't work
in that TK box.

Anyway, thanks a bunch.  If there are other posts
on the NG related to this, I'll see them when I get
home.


Mike Flannigan
Houston, TX


___


Subject:  Re: Regarding Text Widget in Perl/Tk
   Date:  Fri, 30 Jan 2004 10:22:24 -0500
   From:  zentara <[EMAIL PROTECTED]>
 To:  [EMAIL PROTECTED]


On Thu, 29 Jan 2004 20:01:10 +0530, [EMAIL PROTECTED] (Vinesh
Varghese) wrote:

>I am presently working on an Automation project where I am using Active

>state perl as the programming language on windows platform. For the
>above mentioned project I am using Perl/Tk for the GUI. I created a
Text
>Widget and wanted to  show the output from my perl code on the text
box.
>I tried tieing the STDOUT to the text box , but the output is shown
only
>after the program is terminated. What ever I am printing to STDOUT is
>accumulated and shown at once after the program is terminated. I wanted

>to show them as and when the program is running. I don't know where I
am
>mistaken. Please help me in this regard.

Since you don't show your code, it's hard to say what your problem is.

Here is a set of programs, that do what you want.
##
#!/usr/bin/perl -w
use strict;
use Tk;
my $mw = new MainWindow;

my $listbox = $mw->Scrolled("Listbox", -scrollbars => "osoe",
-height => 5,
-selectmode => "multiple")
->pack(-side => "left");

my $start = $mw->Button( -text => 'Start', -command => \&start )->pack;
$mw->Button( -text => 'Exit',  -command => \&exit )->pack;


#start external command to pipe
sub start {
$start->configure(-state => 'disabled');
open(C, "./read-own-stdout-piper 2>&1 |") or warn $!;
$mw->fileevent( \*C, 'readable', \&doSomething );

}

sub doSomething {
if ( eof(C) ) {# Child closed pipe
  close(C);  # Close parent's part of pipe,
# filevent is cancelled as well
  wait;  # Avoid zombies
return;
}
my $text = ;# Get text from child and put it into listbox
chomp($text);
$listbox->insert( 'end', 'Got: ' . $text );
$listbox->see('end');
}

MainLoop;

__END__
##
#and here is read-own-stdout-piper

#!/usr/bin/perl
$|++;
for my $i ( 0 .. 10) {
print $i, "\n";
sleep 1;
}
__END__




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Introduction/Tutorial for Perl/Tk?

2004-02-09 Thread Angel de Vicente
Hi,

you can find a very quick introduction to start you off at
http://www.perltk.org/articles/pm1.htm

Cheers,
Angel de Vicente

Benjamin Walkenhorst writes:
 > Hello everybody,
 > 
 > Can anyone point me to a good introduction to Perl/Tk?
 > I ordered "Mastering Perl/Tk" from O'Reilly, but it's gonna be about two
 > weeks till the book arrives, so I would like to get my hands on
 > something I can work with now. Any online-tutorials?
 > 
 > Thanks a lot,
 > 
 > Kind regards,
 > 
 > Benjamin

-- 
--
http://www.iac.es/galeria/angelv/

PostDoc Software Support
Instituto de Astrofisica de Canarias


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Introduction/Tutorial for Perl/Tk?

2004-02-08 Thread Randy W. Sims
On 2/8/2004 6:06 AM, Benjamin Walkenhorst wrote:
Hello everybody,

Can anyone point me to a good introduction to Perl/Tk?
I ordered "Mastering Perl/Tk" from O'Reilly, but it's gonna be about two
weeks till the book arrives, so I would like to get my hands on
something I can work with now. Any online-tutorials?
Take a look at the Perl Journal archives <http://www.tpj.com/archives/>. 
Beginning with Vol. 1, Steve Lidie wrote a column on TK that became the 
basis for the "Mastering Perl/Tk" book.

Regards,
Randy.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



Introduction/Tutorial for Perl/Tk?

2004-02-08 Thread Benjamin Walkenhorst
Hello everybody,

Can anyone point me to a good introduction to Perl/Tk?
I ordered "Mastering Perl/Tk" from O'Reilly, but it's gonna be about two
weeks till the book arrives, so I would like to get my hands on
something I can work with now. Any online-tutorials?

Thanks a lot,

Kind regards,

Benjamin

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Perl, Tk, and RPMS

2004-02-06 Thread Gary Stainburn
Hi folks.

I run a number of RH7.3 boxes which I keep up to date using Redhat's RPMS.

I've just bought Mastering Perl/Tk and need to install Tk from CPAN.

However, when I try to install Tk it says that I need to have at least Perl 
v5.7, but the latest RH RPMS are 5.6.1.  Is it possible to install Tk on top 
of this version of Perl?

If not, how's the best way to update Perl while causing the minimal effect on 
my machines (I know previously, I've had problems with modules no longer 
working and future RPM updates causing problems).
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: "" and "" in perl/tk

2004-02-03 Thread R. Joseph Newton
Prabu Subroto wrote:

> Dear my friends...
>
> Anybody would be so kind telling me what is similar in
> perl/tk to arrange the location of a form written in
> perl/tk? I want a nice look for my perl/tk
> application.
> Somewhat like this below:
> 1. Name  : 
> 2. Address   : 
> 3. Telephone : 

Thanks, prabu,

The simple explanation above helps us undestand what you are trying
to do.  I'm not sure what the code you included has to do with this
though.  There are a number of problems with it--enough that I
would suggest that you take things one step at a time when learning
Tk.  The Tk library is a large and somewhat complicated animal.
Each widget you put on a window makes things just a little more
complicated, and debugging just a little bit harder.

I recommend adding widget one at a time to your Tk interface, and
thoroughly testing the widget as is bfore moving on.

For instance, the Entry widget in the script as posted seemed to
not work, and could have been dangerous.  That is because you used
a different packing manager, the placer, to put it in the same
frame as items that had been packed:
$judul = $mw->Label(-text => "Network Administrator Main Menu",
'center')->place(-y => 30,

-x => 0);


As posted, the text enetered by the user was hidden behind the
large command button.  Changing the place command to a simple pack
made it possible to see the output.  You might not like the visual
effect, but it is more important that your widgets do their job.
You can jigger the fine details of placement once you know that the
interface functions.

>From what I see of your code, there should be no need to worry
about geometry of the main workspace at all.  Your workspace is a
single-document interface.  When you open a file or select a new
document, the text widget that holds the document's contents should
be cleared.  The code looks very close to what it will take.

I would recommend rebuilding this one widget at a time, and making
sure that you understand how each widget is working before you put
the next one on.  Yes, this is a lot of work. [*shrug*]  Goes with
the territory.

Also, some tips on code formatting:

If you use hanging indents, use them well.  This style calls for
the => operators to be aligned vertically within each set of
name-value pairs.  This helps understand what goes together when
review, editing and debugging code.

Also, blank lines should appear only when there is some break in
flow that you wish to signal.  You should *NEVER* have a blank line
in the middle of a statement, especially if the statement is a
function call.  I am including a re-format of your code to give you
an idea of how it might work better.

So where are you in your study of the Tk library?  How much have
you worked with it?  There is a definite and steep learning curve
to Tk, but it does function very well.

#my current perl/tk code:
#!/usr/bin/perl -w
use Tk;
my $mw = MainWindow->new;
$mw->title("[EMAIL PROTECTED] NA - Linux Server Administrating
Tool");

$frmm = $mw -> Frame(-borderwidth => 2,
  -relief =>'ridge')->pack(
  -side => 'top',
-anchor => 'n',
-expand => 1,
  -fill => 'x');

$mobject = $frmm -> Menubutton(-text => "Administered Object",
  -menuitems => [['command' => "Samba",
   -command => \&menusamba],
['command' => "Squid",
   -command => \&menusquid]])->pack(
 -side  =>'left',
-anchor => 'nw',
-expand => 0);

$msetting = $frmm -> Menubutton(-text => "Setting")->pack(
   -side => 'left',
 -anchor => 'nw',
 -expand => 0,
  -after => $mobject);

$mfile = $frmm -> Menubutton(-text => "File",
  -tearoff => 0,
-menuitems => [["command" => "New Document",
  -command => \&new_document],
"-"])->pack(
  -side => 'left',
-anchor => 'nw',
-expand => 0,
 -after => $msetting);

$doc_num = 1;
$doc_list_limit = 9;
$mw -> Button(-text => "New Document",
  -command =&g

Re: Regarding Text Widget in Perl/Tk

2004-02-03 Thread wolf blaum
For Quality purpouses, zentara 's mail on Saturday 31 January 2004 17:23 may 
have been monitored or recorded as:

>
> It's hard to say without showing us your script.

well, the called script (not the gui) is bout 500 lines...

> Try putting a "TK::after in the event loop to set the timing.

That works: no clue why, bu a great tip. Thanks.

Wolf


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




"" and "" in perl/tk

2004-02-03 Thread Prabu Subroto
Dear my friends...

Anybody would be so kind telling me what is similar in
perl/tk to arrange the location of a form written in
perl/tk? I want a nice look for my perl/tk
application.
Somewhat like this below:
1. Name  : 
2. Address   : 
3. Telephone : 

I have made the main menu of my application with
"Menubutton". And I want if the user click on the menu
that what the user see is only the aimed application
displayed on the determined area (under the main menu)
but the menu has no change in position and form.
Somewhat like on HTML:
===

===



Main menu :
1.biodata

===
So the mainmenu will not have any change only the
content of the display frame will have change as the
user work with this application main menu.

Thank you very much in advance.
===
#my current perl/tk code:
#!/usr/bin/perl -w
use Tk;
my $mw = MainWindow->new;
$mw->title("[EMAIL PROTECTED] NA - Linux Server Administrating
Tool");

$frmm = $mw -> Frame(-borderwidth => 2,
 -relief =>
'ridge')->pack(-side => 'top',
  
-anchor => 'n',
  
-expand => 1,
  
-fill => 'x');

$mobject = $frmm -> Menubutton(-text => "Administrated
Object",
  
  -menuitems => [['command' => "Samba",
  
-command => \&menusamba],
  
['command' => "Squid",
  
-command =>
\&menusquid]])->pack(-side =>
'left', 
  
  
-anchor => 'nw', 
  
  
-expand =>0);
$msetting = $frmm -> Menubutton(-text =>
"Setting")->pack(-side => 'left', 
  
  
  -anchor => 'nw', 
  
  
  -expand => 0, 
  
  
  -after => $mobject);
$mfile = $frmm -> Menubutton(-text => "File",
  
  -tearoff => 0,
  
  -menuitems => [["command" => "New Document",
  
  -command =>
\&new_document],
  
  "-"
  
  ])->pack(-side =>
'left', 
  
  
  -anchor => 'nw', 
  
  
  -expand => 0, 
  
  
  -after => $msetting);
$doc_num = 1;
$doc_list_limit = 9;
$mw -> Button(-text => "New Document",
  -command =>
\&new_document)->pack(-side =>
'bottom',
  
 -anchor =>
'e');
$entry = $mw->Entry(-width => 80)->pack(-expand => 1,
  
 -fill => 'both');

$mexit = $frmm -> Button(-text => "Exit", 
 -command
=> \&keluar, 

-borderwidth => 0)->pack(-side => 'left',
  
 -anchor =>
'nw', 
  
 -expand => 0,

  
 

Re: Regarding Text Widget in Perl/Tk

2004-01-31 Thread R. Joseph Newton
zentara wrote:

> Try putting a "TK::after in the event loop to set the timing.

Yee-haw!!  Just what I was looking for!  Thanks.  Serendipity is a wonderful thing.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-01-30 Thread wolf blaum
For Quality purpouses, zentara 's mail on Friday 30 January 2004 16:22 may 
have been monitored or recorded as:

Hi, 

neat trick! Great.
However, I have a, well, couriosity?

My script looks pretty much the same, except the print in &dosomething
(since it is acctually your script:-))

> Here is a set of programs, that do what you want.
> ##
> #!/usr/bin/perl -w
> use strict;
> use Tk;
> my $mw = new MainWindow;
>
> my $listbox = $mw->Scrolled("Listbox", -scrollbars => "osoe",
> -height => 5,
> -selectmode => "multiple")
> ->pack(-side => "left");
>
> my $start = $mw->Button( -text => 'Start', -command => \&start )->pack;
> $mw->Button( -text => 'Exit',  -command => \&exit )->pack;
>
>
> #start external command to pipe
> sub start {
> $start->configure(-state => 'disabled');
> open(C, "./read-own-stdout-piper 2>&1 |") or warn $!;
> $mw->fileevent( \*C, 'readable', \&doSomething );
>
> }
>
> sub doSomething {
> if ( eof(C) ) {# Child closed pipe
>   close(C);  # Close parent's part of pipe,
> # filevent is cancelled as well
>   wait;  # Avoid zombies
> return;
> }
> my $text = ;# Get text from child and put it into listbox
> print $text;  #only diffeerence.
   chomp($text);
> $listbox->insert( 'end', 'Got: ' . $text );
> $listbox->see('end');
> }
>
> MainLoop;
>
> __END__
> ##


and the called script looks different (but prints to STDOUT and has a $|++ for 
flush.

When I call the GUI from a command prompt opend under X I should see two 
parallel outputs, one in the terminal and one in the listbox, right.

I do see these outputs on both, but the one in the listbox  is way slower than 
the one to the console. However, the relation seams to be random (ie there is 
no, say constant 5 line adtvantage).
I also tried the 
tie @array, "Tk::Listbox", $listbox in &start and only call 
$listbox->see('end') in &dosomething with the result, that I get to see the 
whole output in the listbox at once and only when the callled script is 
finished.

Any Idea?

Thanks a lot, 
Wolf


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Perl/Tk and portability

2004-01-30 Thread wolf blaum
For Quality purpouses, Gary Stainburn 's mail on Friday 30 January 2004 16:26 
may have been monitored or recorded as:
> Hi folks,
>

Hi Gary,

> As I've never looked at Tk before I would appreciate people's opinions on
> it. Specifically, how easy is it to develop, and how portable is it between
> the two platforms?

I havent read your privious thred, so I dont really know if this is helpful 
for you:

most of the scripts I ever wrote that I wanted to have a GUI for were scripts 
that needed (sometimes complicated) config files.
So what I did was writing qw/simle/ GUIs using Tk to produce these config 
files, that way keeping program logic and User Interface seperate (and easily 
exchangable). In that approach it is possible to do a little interactivity 
even when the "real" programm is running, but if you need to promt users for 
something ever second at runtime, thats probably to not a good idea.
However, the GUIs are pretty reusable and for these simple tasks pretty easy 
to write.

> Any comments about deploying on a Windows platform would also be
> appreciated (I want to provide it as a download, so simple install would be
> good). --

The pairs of script/gui I wrote so far worked fine on SuSe Linux 8.0 up and 
Win32 (didnt try other OS).
I once did a Win package for download using the tarma installer TI 
(www.tarma.com) which installed activestateperl if required and my script/GUI 
pair  - TI is freeware that produces a Win Installer for you. Worked fine.

If you only need to do a Win GUI, look at the GUI Loft, too. (www.banhof.se/
~johanl/perl/Loft/)
Thats a WYSIWYG GUI design tool, pretty delphi like, except that it doesent 
produce code but a design file which you can work with in you app, so you can 
click your GUI together and focus on the logic. Neat thing. 

As Joseph was pointing out, examples in the Tk docu are an endangerd species: 
Mastering Perl/Tk by Steve Lidie and Nacy Walsh is an extended zoo of these. 

Enjoy clicking around, Wolf


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Perl/Tk and portability

2004-01-30 Thread Gary Stainburn
Hi folks,

I'm looking to write an app that I want both Linux and Windows users to be 
able to use.  This app will be interactive (my train simulator/controller app 
for those who followed my previous threads) so I will need some form of user 
interface.

As I've never looked at Tk before I would appreciate people's opinions on it. 
Specifically, how easy is it to develop, and how portable is it between the 
two platforms?

Any comments about deploying on a Windows platform would also be appreciated 
(I want to provide it as a download, so simple install would be good).
-- 
Gary Stainburn
 
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 




Re: Regarding Text Widget in Perl/Tk

2004-01-29 Thread R. Joseph Newton
[EMAIL PROTECTED] wrote:

> Hi Friends,
>
> I am presently working on an Automation project where I am using Active
> state perl as the programming language on windows platform. For the
> above mentioned project I am using Perl/Tk for the GUI. I created a Text
> Widget and wanted to  show the output from my perl code on the text box.
> I tried tieing the STDOUT to the text box , but the output is shown only
> after the program is terminated. What ever I am printing to STDOUT is
> accumulated and shown at once after the program is terminated. I wanted
> to show them as and when the program is running. I don't know where I am
> mistaken. Please help me in this regard.
>
> Thanks is Advance,
>
> Vinesh

The text appearing in a Tk [or any other GUI library] widget
is an attribute, generally '-text', of the
widget.  It has nothing to do with standard input/output
communications.  In order to properly manage the
behavior of Tk widgets, you must understand the widget
itself.

perldoc Tk::Text
perldoc Tk::WidgetName

Joseph

Hmmm--this didn't go through to the group because something
hashed the list address.  Just as well.  The Tk docs are
very poor in samples, so here is a small working example of
loading some text to a Text widget.  They are complicated
little buggers, and if you do the lead work of reading the
docs, I am happy to help clarify some of the questions the
docs raise.  I'm sure others will be also, but you do have
to start by reading the docs for any Tk widget you are
trying to use.

  my $text = '';
  open IN, "txt/txt$padded_path.txt" or die "Could not open
$!";
  my $line;
  $text .= $line while $line = ;
  close IN or die "Could not close $!";
  my $text_area = $message_area->{'SubWidget'}->{'text'};
  $text_area->delete('0.1', 'end');
  $text_area->insert('end', $text);

The snippet above clears a text widget entirely, and loads
it from the start--in this case, also the end, with the new
text held in $text.


Joseph

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Regarding Text Widget in Perl/Tk

2004-01-29 Thread vinesh.varghese

Hi Friends,

I am presently working on an Automation project where I am using Active
state perl as the programming language on windows platform. For the
above mentioned project I am using Perl/Tk for the GUI. I created a Text
Widget and wanted to  show the output from my perl code on the text box.
I tried tieing the STDOUT to the text box , but the output is shown only
after the program is terminated. What ever I am printing to STDOUT is
accumulated and shown at once after the program is terminated. I wanted
to show them as and when the program is running. I don't know where I am
mistaken. Please help me in this regard.

Thanks is Advance,

Vinesh


Confidentiality Notice

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.

  1   2   >