Re: Gtk3 and subclassing



On 01.12.18 17:00, Jeff via gtk-perl-list wrote:
The code below is cut down from that in gscan2pdf, where in a separate
file, the subclass, and thus the add_events() call works fine. Here, I get:

Can't locate object method "add_events" via package "My::Canvas" at
gtk3-subclass2.pl line 15.

I still can't work out why and would appreciate some insight.

Looks like GooCanvas2.pm neglects to pull in Gtk3.pm, so either patch GooCanvas2.pm or "use Gtk3" yourself before you "use GooCanvas2".

Also, as of Gtk3.pm version 0.032 you do not need to use Glib::Object::Introspection->convert_sv_to_flags for the mask argument of add_events() anymore but can instead simply use something like this:

        [qw/exposure-mask
            button-press-mask
            button-release-mask
            pointer-motion-mask
            scroll-mask/]

-Torsten


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]