Finance-Quant

 view release on metacpan or  search on metacpan

scripts/FINANCE_QUANT_TRAY  view on Meta::CPAN

   size_allocate      => \&on_size_allocate,
   style_set          => \&on_style_set,
   expose_event       => \&on_expose_event,
   enter_notify_event => \&on_enter_notify_event,
   leave_notify_event => \&on_leave_notify_event,
 },
 properties => [

   Glib::ParamSpec->object(
      'parent_widget',                                   'parent_widget',
      'The parent widget on which this popup will show', 'Gtk2::Widget',
      [ qw/readable writable/ ]
   ),
   Glib::ParamSpec->string(
      'message',
      'message',
      'The heading for this message',
      'This is sample heading',
      [ qw/readable writable/ ]
   ),

scripts/FINANCE_QUANT_TRAY  view on Meta::CPAN


my $statusicon = Gtk2::StatusIcon->new_from_pixbuf($icopixbuf);
# will make a nice icon automagically from a file if desired
#my $statusicon = Gtk2::StatusIcon->new_from_file('stock.png');

$statusicon->set_tooltip( "Info v1.0" );
#show in tray
$statusicon->set_visible( 1 );

$statusicon->signal_connect( 'activate',   sub { print "1\n" } );
$statusicon->signal_connect( 'popup-menu', \&config_it );

my $vbox = Gtk2::VBox->new;
my $b    = Gtk2::Button->new_from_stock( "gtk-close" );
$b->signal_connect('button_press_event' => sub { exit  });
$vbox->pack_start( $b, TRUE, TRUE, 0 );
$window->add( $vbox );
$vbox->show_all;

#$window->show_all();
#$window1->show_all();

scripts/FINANCE_QUANT_TRAY  view on Meta::CPAN

  my $stb=`tree -f /tmp/Finance-Quant/ | egrep -c 'ibes-strong-buy'`;
  my $symbols = `tree /tmp/Finance-Quant/ | egrep directories`;
  my $charts=`tree -f /tmp/Finance-Quant/ | egrep -c 'charts'`;
  

 # $symbols =~ s/^(.*)directories, (.*)files/$2/;
  
  
  
  my $test = Gtk2::Ex::ZNotify->new(
      type          => 'popup',
      #   parent_widget => $window, # undefind, use x y location
      "messageType"   => "info",
      "timeout"       => 10000,
      "message"       => "".($symbols)."strong buy:".($stb-1)."\nbacktests:".$bt."reports:".$reports." charts:".$charts,
      "x"             => ($x + $w/2),
      "y"             => ($y + $h ),
   );
 $test->show_all();
 return  1;	# don't run again
  });

scripts/FINANCE_QUANT_TRAY  view on Meta::CPAN



sub config_it{

my $menu = menu();
   $menu->show_all();

 #to position the menu under the icon, instead of at mouse position
 my ($x, $y, $push_in) = Gtk2::StatusIcon::position_menu($menu, $statusicon);
 print "$x, $y, $push_in\n";
 $menu->popup( undef, undef, sub{return ($x,$y,0)} , undef, 0, 0 );
 return 1;
}

1;


__DATA__
=head1 NAME
  
  FINANCE_QUANT_TRAY



( run in 2.157 seconds using v1.01-cache-2.11-cpan-364913b4093 )