Re: RecentInfo



> On 7/25/06, Jonathon Jongsma <jonathon jongsma gmail com> wrote:
>> I'm trying to use the list of recent items, i.e.:
>>   std::vector<Glib::RefPtr<Gtk::RecentInfo> > info_list =
>> m_refRecentManager->get_items();
>>
>> But when I compile this, it complains that RecentInfo doesn't have
>> reference() and unreference() functions.  I'm assuming that most
>> things managed by RefPtr get their reference() and unreference()
>> functions through inheritance from Glib::Object or something, but what
>> about things that are not GObject-based types?

RecentInfo should have reference() and unreference() functions that are
implemented with
gtk_recent_info_ref() and gtk_recent_info_unref()
http://developer.gnome.org/doc/API/2.0/gtk/gtk-GtkRecentManager.html#id3947230
because they are mentioned in the _CLASS_BOXEDTYPE macro:
http://cvs.gnome.org/viewcvs/gtkmm/gtk/src/recentinfo.hg?view=markup

If they aren't being generated then that's a bug. Sorry, I'm not at my
computer now.

>> I added the following lines to get it to compile
>>   _WRAP_METHOD(void reference() const, gtk_recent_info_ref)
>>   _WRAP_METHOD(void unreference() const, gtk_recent_info_unref)
>>
>> Is there a better way to do this or should I commit the lines above?
>
> Looking into this further, when I do add these methods 'manually' I'm
> getting a segfault with the following backtrace (using valgrind since
> it demangled it nicely for me):

[snip]

> So what's the best way to solve this?  Create a new specialization for
> RefPtr managed types that aren't GObject types?

Yes, you probably need to provide a Traits specialization. You should be
able to find some similar onese around gtkmm and friends.

[snip]


Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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