Socrates has asked for the wisdom of the Perl Monks concerning the following question:
When I click the icon for the first time, the window appears just as it is supposed to and gmail renders inside of it. I close it, and it hides. When I click the icon again, however, the window returns, but it is simply grey, with no controls inside of it, and any further attempts to call methods on the MozEmbed object do nothing. I've tried replacing the MozEmbed object with a simple icon, and it works; the icon persists over hide-show cycles. Is there something more I need to be doing, or is this a bug in Gtk2::MozEmbed?#!/usr/bin/perl use Glib qw(TRUE FALSE); use Gtk2 -init; use Gtk2::MozEmbed; use Gtk2::TrayIcon; Gtk2->init; Gtk2::MozEmbed -> set_profile_path($ENV{ HOME } . "/.mybrowser", "MyBr +owser"); my $window = Gtk2::Window -> new(); my $moz = Gtk2::MozEmbed -> new(); $window -> signal_connect(delete_event => sub { $window->hide_all; return TRUE; }); $window -> set_title("MyBrowser"); $window -> set_default_size(600, 400); $window -> add($moz); $moz -> load_url("http://gmail.com"); # Tray icon my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file("/usr/share/icons/gnome/ +24x24/apps/gnome-window-manager.png"); my $icon = Gtk2::Image->new_from_pixbuf($pixbuf); my $trayicon = Gtk2::TrayIcon->new("browser"); my $tooltip= Gtk2::Tooltips->new; $tooltip->set_tip($trayicon, "browser"); my $eventbox = Gtk2::EventBox->new; $eventbox->add($icon); $trayicon->add($eventbox); $eventbox->signal_connect(button_release_event=> sub{ $window->show_all; }); $trayicon->show_all; Gtk2->main;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Gtk2::MozEmbed difficulties.
by Anonymous Monk on Aug 26, 2008 at 06:23 UTC |