4 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
#!/usr/bin/perl
use Tk;
use strict;
use warnings;
my $main = MainWindow->new;
my $entry = $main->Entry( -text => 'bla' ) -> pack();
$main->Button( -text => 'leer', -command => sub { $entry->configure( -text => '' ); } ) -> pack();
$main->Button( -text => 'nicht leer', -command => sub { $entry->configure( -text => 'nicht leer' ); } ) -> pack();
MainLoop;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/usr/bin/perl use Tk; use strict; use warnings; my $main = MainWindow->new; my $var = 'bla'; my $entry = $main->Entry( -textvariable => \$var ) -> pack(); $main->Button( -text => 'leer', -command => sub { $var = q~~ } ) -> pack(); $main->Button( -text => 'nicht leer', -command => sub { $var = 'nicht leer' } ) -> pack(); MainLoop;
4 Einträge, 1 Seite |