Muskovitz has asked for the wisdom of the Perl Monks concerning the following question:
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; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: I can't create a new Gtk2 window
by dave-theunsub (Scribe) on Jan 06, 2015 at 12:58 UTC | |
by Muskovitz (Scribe) on Jan 06, 2015 at 14:01 UTC | |
by MidLifeXis (Monsignor) on Jan 06, 2015 at 14:31 UTC |