Re: Gnome2::IconList bug



"Cristóvão B. B. Dalla Costa" said:
Hello,

While trying to connect a signal to a Gnome2::IconList widget the
program bombed with the following error:

Can't locate object method "signal_connect" via package
"Gnome2::IconList" at Interface.pm line 13.

Further investigation with the debugger, using the 'm' command to list
its methods, revealed that the Gnome2::IconList class inherits from
none. I worked around the problem by inserting the following line in my
startup code:

@Gnome2::IconList::ISA = ('Gtk2::Widget');

This now allows me to connect signals to widgets of the aforementioned
class. I believe this is a very simple bug in the declaration of the
class. If there's anything else I might do to help, please ask.

you solution, of course, is a temporary workaround.

i can confirm the problem, looking at the pod of Gnome2::IconList doesn't show
any heirarchy.

from the looks of it (icon list header file) GnomeIconList is a GnomeCanvas
which would mean that Gnome2 probably needs to depend on Gnome2::Canvas, in
fact if i add 'use Gnome2::Canvas;' to Gnome2.pm the problem goes away and the
pod now shows the hierarchy. (note that the real solution will involve more
than just adding the use statement.)

kaffee thoughts?

this probably means we ought to add some sort of test to verify the hierarchy,
at least one level of it, for all of the objects types. there's plenty of
tests for this object type, but they only test methods on it, not it's
ancestors.

probably the simplest thing to do is to make sure that all things that derive
from something, can access a method in the base class of that something. which
in most cases would be Glib::Object. to do this reliably (making sure that we
aren't faked out by overridding of the method in the local class) we could add
something to Gtk2::TestHelper with a Glib::Object package like,
$object->something_unique_in_base_gobject that just returns true and would
never be overridden. that would give us a method to be called only in tests,
on any gobject derived class. we could add others for the few cases of thigns
that aren't gobject derived.

-rm




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