- From: Robert Pearce <rob bdt-home demon co uk>
- To: gtkmm-list gnome org
- Subject: Re: Maemomm
- Date: Mon, 25 Jun 2007 22:45:29 +0100
On Mon, 25 Jun 2007, Murray Cumming <murrayc murrayc com> wrote :
Declare in constructor. It does not show error. but when i am going to
use the functions in the .cc files it shows error like:
Line 37 here:
gc = get_style()->get_fg_gc(get_state());
You probably mean win->draw_pixmap. The RefPtr smartpointer needs
similar syntax to a pointer. That would explain your second error,
though not your first.
ScribbleDrawingArea.cc:37: error: cannot convert `Glib::RefPtr<Gdk::GC>'
to `Gdk::GC*' in assignment
What happens if you just change the declaration of gc to
As I understand it, a RefPtr can't be assigned to a normal C++ pointer,
because it loses the reference counting. However, a RefPtr will be
_cast_ to a C++ pointer automatically and invisibly, because the user of
the C++ pointer won't be doing anything with the reference count.
Not that I'm an expert on this, but that's the impression I get.
Rob Pearce http://www.bdt-home.demon.co.uk
The contents of this | Windows NT crashed.
message are purely | I am the Blue Screen of Death.
my opinion. Don't | No one hears your screams.
believe a word. |
] [Thread Prev