i can't figure out why i can't create a new Gtk2 window here's the sample code
very weird code, but the question is can i create a new gtk2 window w/ a button?#!/usr/bin/perl use Gtk2 '-init'; use Glib qw/TRUE FALSE/; my $window=Gtk2::Window->new; $window->signal_connect('delete_event',sub{Gtk2->main_quit;}); my $vbox1=Gtk2::VBox->new; my $button=Gtk2::Button->new("Open a new Window"); $button->signal_connect(clicked=>sub{ &newWindow; }); $vbox1->add($button); $window->add($vbox1); $window->show_all; Gtk2->main; sub newWindow{ my $mw=Gtk2::Window->new('toplevel'); $mw->set_default_size(250, 250); Gtk2->main; }
In reply to I can't create a new Gtk2 window by Muskovitz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |