8 my $area = Gtk2::DrawingArea->new();
11 my $win = $area->window;
12 my $alloc = $area->allocation;
13 my $w = $alloc->width;
14 my $h = $alloc->height;
15 print "Area $w x $h\n";
17 ## my $sty = $area->style;
18 ## my $gc = $sty->fg_gc($area->state);
19 my $gc = Gtk2::Gdk::GC->new($win);
20 $gc->set_rgb_background(0x000000);
21 $gc->set_rgb_foreground(0x000000);
22 $win->draw_rectangle($gc, 1, 0, 0, $w, $h);
23 $gc->set_rgb_foreground(0x00ff00);
24 $win->draw_line($gc, $xx, 0, $w-1, $h-1);
26 if ($xx >= $w) { $xx=0; }
30 $area->signal_connect("expose-event" => sub {
32 if (!defined $timer) {
33 $timer = Glib::Timeout->add(10, sub { draw(); return 1; });
37 my $window = Gtk2::Window->new ('toplevel');
38 $window->signal_connect ("delete-event" => sub { Gtk2->main_quit });
39 $window->set_title("Brum");
40 $window->set_wmclass("anim", "Anim");
41 $window->set_default_size(640, 480);