StatusIcon color shift on blinking



Hi, 

I'm trying to convert a script from using TrayIcon to StatusIcon.
All is going well except for some color changing during blinking.

Using a previous example by Emmanuel Rodriguez ( I added a blink button
to the menu); I get a background color change on ICE Window Manager, where
my tray is black. Can anyone run this, and tell me if it's due to ICEWM, or
is there a way to maintain color during flashing.

#!/usr/bin/perl
use strict;
use warnings;
use Glib qw(TRUE FALSE);
use Gtk2 '-init';

exit main();

sub main {

    # Create a system tray icon
    my $tray = Gtk2::StatusIcon->new_from_stock('gtk-color-picker');
   
    # Build the tray's popup menu
    my $tray_menu = Gtk2::Menu->new();
    $tray_menu->append(Gtk2::SeparatorMenuItem->new());
   
    # Add a blinking menu item
    my $menu_item_blink = Gtk2::ImageMenuItem->new('Blink');
    $menu_item_blink->signal_connect(activate => sub {
    $tray->set_blinking(1);   
    });
    $tray_menu->append($menu_item_blink);

    # Add a close menu item
    my $menu_item_close = Gtk2::ImageMenuItem->new_from_stock('gtk-close');
    $menu_item_close->signal_connect(activate => sub {
        Gtk2->main_quit();
    });
    $tray_menu->append($menu_item_close);


    $tray_menu->show_all();


    # Show the menu when there's a right click
    $tray->signal_connect('popup-menu' => sub {
            my ($tray, $button, $time) = @_;
            $tray_menu->popup(
                undef,
                undef,
                \&Gtk2::StatusIcon::position_menu,
                $tray,
                $button,
                $time
            );
    });

    # Start the main loop
    Gtk2->main();
   
    return 0;
}


Thanks, zentara



-- 
I'm not really a human, but I play one on earth.
http://zentara.net/Remember_How_Lucky_You_Are.html 



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