Re: _WRAP_METHOD error
- From: Johannes Schmid <johannes schmid gmx de>
- To: Paul Davis <pjdavis engineering uiowa edu>
- Cc: gtkmm-list gnome org
- Subject: Re: _WRAP_METHOD error
- Date: Wed, 27 Sep 2006 20:05:48 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
What about:
WRAP_METHOD(View* get_canvas_view(),goo_canvas_item_view_get_canvas_view) ?
That should at least give you working code because wrap does just return
a Pointer. I you want something else, like a RefPtr you might have to
code it by hand.
Regards,
Johannes
Paul Davis wrote:
> Hey,
>
> Can anyone else make heads or tails of this?
>
> Wrapping this function:
>
> GooCanvasView
> <http://gooey.ecn.uiowa.edu/goocanvas/GooCanvasView.html>* goo_canvas_item_view_get_canvas_view (GooCanvasItemView <http://gooey.ecn.uiowa.edu/goocanvas/GooCanvasItemView.html> *view);
>
> Using this macro:
>
> _WRAP_METHOD( Glib::RefPtr<View>
> get_canvas_view(),goo_canvas_item_view_get_canvas_view)
>
> Produces this code:
>
> Glib::RefPtr<View> ItemView::get_canvas_view()
> {
> return Glib::wrap(goo_canvas_item_view_get_canvas_view(gobj()));
> }
>
> and cause this error at compile time:
>
> itemview.cc : In member function 'Glib::RefPtr<GooCanvas::View>
> GooCanvas::ItemView::get_canvas_view()':
> itemview.cc:127: error: conversion from 'GooCanvas::View*' to non-scalar
> type 'Glib::RefPtr<GooCanvas::View>' requested
>
> This method seems like it should make everything ok:
>
> namespace Glib
> {
>
> GooCanvas::View* wrap(GooCanvasView* object, bool take_copy)
> {
> return dynamic_cast<GooCanvas::View *> (Glib::wrap_auto
> ((GObject*)(object), take_copy));
> }
>
> } /* namespace Glib */
>
> Any thoughts would be helpful
> Paul
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFGr177Dsf+G5b/WsRAiQBAKCvBYG3YztN+v4adwuHikMGP3CiwQCfYdIe
tdOZDUFPE/4UY6mVVeXxknc=
=5IY0
-----END PGP SIGNATURE-----
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]