Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to upgrade some old code from Gtk2 to Gtk3.
Most dependencies still work, but Gnome2::Canvas and Gnome2::Wnck are a complete loss. I can replace Gnome2::Canvas with GooCanvas2 easily enough, but what can be done about replacing WNCK?
#!/usr/bin/perl package testgtk3; use strict; use diagnostics; use warnings; use Gtk3 '-init'; #use Gnome2::Canvas; use Gnome2::Wnck; my $window = Gtk3::Window->new('toplevel'); $window->signal_connect('delete_event' => sub { Gtk3->main_quit; }); $window->set_border_width(5); $window->set_title('Gtk3 test'); my $button = Gtk3::Button->new("Hello world!"); $button->signal_connect(clicked => sub { my ($button) = @_; print "Hello world!"; $window->destroy(); }); $window->add($button); $button->show(); $window->show(); Gtk3->main(); 1;
Any such script with use Gnome2::Wnck produces a million error messages, starting with:
Subroutine Pango::Color::parse redefined at /usr/lib/x86_64-linux-gnu/perl/5.26/DynaLoader.pm line 204 (#1) (W redefine) You redefined a subroutine. To suppress this warning +, say { no warnings 'redefine'; eval "sub name { ... }"; } Subroutine Pango::Color::to_string redefined at /usr/lib/x86_64-linux-gnu/perl/5.26/DynaLoader.pm line 204 (#1) Subroutine Pango::Attribute::end_index redefined at /usr/lib/x86_64-linux-gnu/perl/5.26/DynaLoader.pm line 204 (#1) Subroutine Pango::Attribute::start_index redefined at /usr/lib/x86_64-linux-gnu/perl/5.26/DynaLoader.pm line 204 (#1)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Upgrade Gtk2 to Gtk3, and Gnome2::Wnck breaks
by zentara (Cardinal) on Dec 29, 2018 at 22:21 UTC | |
by Anonymous Monk on Dec 30, 2018 at 09:25 UTC | |
by zentara (Cardinal) on Dec 30, 2018 at 14:38 UTC | |
by Anonymous Monk on Dec 30, 2018 at 16:18 UTC | |
|
Re: Upgrade Gtk2 to Gtk3, and Gnome2::Wnck breaks
by Anonymous Monk on Dec 30, 2018 at 03:15 UTC | |
by zentara (Cardinal) on Dec 30, 2018 at 14:27 UTC | |
by Anonymous Monk on Dec 30, 2018 at 16:17 UTC |