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)

In reply to Upgrade Gtk2 to Gtk3, and Gnome2::Wnck breaks by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.