How can I give a 'top-level' window the same 'popup' functionality as the Gtk2::Menu widget? | [reply] |
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;
}
| [reply] [d/l] |
What is the address of this maillist, I cant find it anywhere!!
| [reply] |