Thread Poe: Frage zu Example (9 answers)
Opened by Froschpopo at 2005-04-07 00:24

Froschpopo
 2005-04-07 00:24
#43362 #43362
User since
2003-08-15
2653 Artikel
BenutzerIn
[default_avatar]
Ich hab mir hier von poe.perl.org dieses Beispiel gezogen:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use Tk;
use POE;

POE::Session->create(
inline_states => {
_start => \&handle_start,
ev_count => \&handle_count,
ev_clear => \&handle_clear,
}
);

POE::Kernel->run();
exit 0;

sub handle_start {
$poe_main_window->Label(
-text => "Counter"
)->pack;

$_[HEAP]->{counter_widget} =
$poe_main_window->Label(
-textvariable => \$_[HEAP]->{counter}
)->pack;

$poe_main_window->Button (
-text => "Clear",
-command => $_[SESSION]->postback("ev_clear")
)->pack;

$_[KERNEL]->yield("ev_count");
}

sub handle_count {
$_[HEAP]->{counter}++;
$_[KERNEL]->yield("ev_count");
}

sub handle_clear {
$_[HEAP]->{counter} = 0;
}


Nun hab ich zwei Fragen:

Warum kann ich das Script nicht mit nem normalen Klick auf "schließen" beenden?

UND

warum das exit 0 ?

View full thread Poe: Frage zu Example