libwnck doesn't work well in gtk-perl?



I have this simple script that demonstrates my problem

#!/usr/bin/perl

use strict;
use Gtk2;
use Gnome2::Wnck;
Gtk2->init();

while (1) {
        sleep 1;

        my $screen = Gnome2::Wnck::Screen->get(0);
        $screen->force_update();

        my @windows_list = $screen->get_windows();

        foreach my $window (@windows_list) {
                my $name = $window->get_name();
                print "name = $name\n";
        }

}

I would expect it to print out all the window names on screen 0. It does that the first time its called, but if window names are added or removed or changed, it just continues to print the original names.

I'm probably doing something stupid, but there isn't a lot of documentation for wnck in libtk-perl beyond the api (not even sure what force_update is for, just that the little documentation I saw, used it).

thanks.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]