Re: reset text widget
- From: props666999@xxxxxxxxxxxxxx
- Date: 12 Dec 2006 06:13:28 -0800
Apologies for not explaining properly.
For the first issue whenever i press the puss_button in the
$txtapotimhsh the previous values stays there . i want every time to
get the new one not the old one plus the new value next to it . How to
reset the value ??
my $addbutton = $frm_name3 -> Button(-text => "Prosthesi",-command
=>\&push_button) ->pack(-side=>'left');
$txtapitimhsh = $frm_name4 -> Text(-width=>8, -height=>1)
->pack(-side=>'right');
sub push_button {
@totalmetoxwn = 0;
push(@totalmetoxwn,$telikitimh);
foreach (@totalmetoxwn) {
$sunolometoxwn += $_ ;
$txtapitimhsh -> insert('end',$sunolometoxwn);
}
For the second issue . I want my algorithms to send some output on a
daily file with filename the current date (such as 12/12/2006). The
inly way i can imagine is via
the localtime() function.The localtime is too big for filename Correct
me if iam wrong
Thank You
Ο/Η zentara έγραψε:
On 11 Dec 2006 14:14:53 -0800, props666999@xxxxxxxxxxxxxx wrote:
Hi
I use a button which does some calculations and a text widget which
displays these calculations.Unfortunately whenever i push the button
continues from the previous state and messes up my formulas. How can i
reset the content of a text widget ?.
Also this is not TK relevant but how can i match the first 10
characters from localtime()
for instance
$date = localtime();
$my_match= /(localtime()\s{10}/ \ i hope you understand my objective
The localtime() within the match blocks i assume is not correct. Please
assist
Thanks in advance
Can you provide a simple example, it is hard for us to know what
you are doing. It dosn't sound like a text widget problem.
As far as localtime is concerned, what are you trying to do?
It dosn't make sense to get 10 characters, because the useful
count can change. You probably want to use POSIX
#!/usr/bin/perl
use warnings;
$date_string = localtime;
@date_parts = localtime;
print "$date_string \n";
print "@date_parts \n";
__END__
# maybe you want this?
#!/usr/bin/perl
use POSIX qw(strftime);
my $file = strftime( 'file-%m-%d-%Y.zip', localtime );
print "$file\n";
__END__
--
I'm not really a human, but I play one on earth.
http://zentara.net/japh.html
.
- Follow-Ups:
- Re: reset text widget
- From: zentara
- Re: reset text widget
- References:
- reset text widget
- From: props666999
- Re: reset text widget
- From: zentara
- reset text widget
- Prev by Date: Re: Keyboard options for brose entry widget
- Next by Date: Re: fix for gedi
- Previous by thread: Re: reset text widget
- Next by thread: Re: reset text widget
- Index(es):