Thread Automatische Aktualisierung (9 answers)
Opened by Emigrant at 2008-01-31 23:44

topeg
 2008-02-02 20:05
#105489 #105489
User since
2006-07-10
2611 Artikel
BenutzerIn

user image
Allso das funktioniert:

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
41
#!/usr/bin/perl

use strict;
use warnings;
use Gtk2 '-init';

my $cnt=0;
Glib::Timeout->add (1000, \&gibmir);

my $window= Gtk2::Window->new();

my $vbox=Gtk2::VBox->new(0,0);
$window->add($vbox);

my $quit = Gtk2::Button->new("Kill me softly");
$quit->signal_connect (clicked => sub { &stop; } );
$vbox->pack_start($quit,0,0,0);

my $count = Gtk2::Label->new(' COUNT: 0 ');
$vbox->pack_start($count,0,0,0);

$window->show_all;
Gtk2->main;

sub aktuell
{
$count->set_text(" COUNT: $cnt ");
}

sub gibmir
{
$cnt++;
&aktuell;
return 1;
}

sub stop
{
Gtk2->main_quit;
exit(0);
}


Nebenbei, ich kann dir nicht viel helfen, wenn du mir unvollständigen Beispielcode zeigst.
Da kann ich nur raten was vorher steht und was danach. der fhelr muß ja nicht an der stelle sein, die du zeigst.
Was z.B ist "$table" oder was steht in "&aktuell" wo ist das "Gtk2->main" u.s.w. u.s.f.

View full thread Automatische Aktualisierung