in reply to Re: Gtk2: adding a progressbar to the menu
in thread Gtk2: adding a progressbar to the menu

How can I give a 'top-level' window the same 'popup' functionality as the Gtk2::Menu widget?
  • Comment on Re^2: Gtk2: adding a progressbar to the menu

Replies are listed 'Best First'.
Re^3: Gtk2: adding a progressbar to the menu
by zentara (Cardinal) on Jul 26, 2007 at 13:05 UTC
    Well here is how to make a popop that you can put your progressbar in. As far as how to make it pop when your menu item is clicked, just put the show_all in the callback for the menuitem click. Like I said, you might want to ask this on the Perl/Gtk2 maillist, where the gtk2 gurus hang out.... they may know a better way.
    #!/usr/bin/perl use warnings; use strict; use Glib qw/TRUE FALSE/; use Gtk2 '-init'; my $window = Gtk2::Window->new('toplevel'); my $window1 = Gtk2::Window->new('popup'); $window ->signal_connect( 'destroy' => \&delete_event ); $window->set_size_request(300,200); $window1->set_size_request(100,100); my $button = Gtk2::Button->new_from_stock('gtk-quit'); $window->add( $button ); $button->signal_connect( clicked => \&delete_event ); $window->set_position('center'); #$window1->set_position('center'); $window1->move(200,200); $window->show_all(); $window1->show_all(); Gtk2->main; ##################################### sub delete_event { Gtk2->main_quit; return FALSE; }

    I'm not really a human, but I play one on earth. Cogito ergo sum a bum
      What is the address of this maillist, I cant find it anywhere!!
        gtk-perl maillist , but I see your post showed up this morning. The archives there, are a great place to search for answers too.

        I'm not really a human, but I play one on earth. Cogito ergo sum a bum