Re: [GTKMM] Standalone pixmap

Rob Benton wrote:
> Passing a Gdk::Drawable into the Gdk::Pixmap::create() method does not 
> associate it or anything like that.  All it does is set the Pixmap's 
> depth to that of the Gdk::Drawable you passed in.
> If I'm wrong someone please correct me.  I looked at the Gtk 
> "gdk_pixmap_new()" function for this info.

Thanks for anwsering.

I think you're right. I've checked this once again. I misunderstood it
because I thought I've checked it once and for example I couldn't create
a pixmap with size for 10x20 and had to create a pixmap using get_width
(), get_height() methods. But it was probably very late ;/.

But from what I read if I set my own depth (diffrent from -1) I don't
have to give any Gdk::Drawable. The question is how to do it?

 Glib::RefPtr<Gdk::Pixmap> pixmap = Gdk::Pixmap::create(

does not work as I had written before. I know that it should be a
reference, but how can I pass a null-reference? Using some Glib stuff?
It an argument were a pointer it should work, but now I of course get
errors like this:

../ In member function `bool
../ error: no matching function for call to
   create(NULL, int, int, int)'
/usr/include/gdkmm-2.4/gdkmm/pixmap.h:122: error: candidates are: static
   Glib::RefPtr<Gdk::Pixmap> Gdk::Pixmap::create(const
   Glib::RefPtr<Gdk::Drawable>&, int, int, int)
/usr/include/gdkmm-2.4/gdkmm/pixmap.h:125: error:                 static
   Glib::RefPtr<Gdk::Pixmap> Gdk::Pixmap::create(const
   Glib::RefPtr<Gdk::Drawable>&, const char*, int, int, int, const
   const Gdk::Color&)
/usr/include/gdkmm-2.4/gdkmm/pixmap.h:128: error:                 static
   Glib::RefPtr<Gdk::Pixmap> Gdk::Pixmap::create(const
   Glib::RefPtr<Gdk::Display>&, unsigned int)

Once again thanks for any suggestions in advance.


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