Re: Maemomm

On Mon, 25 Jun 2007, Murray Cumming <murrayc murrayc com> wrote :
 Gdk::Pixmap *pixmap;
  Gdk::GC *gc;

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());
    win.draw_pixmap(gc ,
            event->area.x, event->area.y,
            event->area.x, event->area.y,
            event->area.width, event->area.height);

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. error: cannot convert `Glib::RefPtr<Gdk::GC>'
to `Gdk::GC*' in assignment

What happens if you just change the declaration of gc to
   Glib::RefPtr<Gdk::GC> gc;

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             

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.      |

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