How to uninstall drag icon set up via drag_source_set_icon()?



In one of my Gtkmm applications (using version 2.4.7), I'm setting up a "drag source icon" using Gtk::Widget::drag_source_set_icon(Glib::RefPtr<Gdk::Colormap> &, Glib::RefPtr<Gdk::Pixmap>&, Glib::RefPtr<Gdk::Bitmap>&);

This seems to work fine, but I also want to uninstall the icon some time later, and can't figure out how. That is, what I've tried to do, is to replace the pixmap/bitmap combination with a stock icon using another variant of the above mentioned method. I think this also works in the sense that the visible icon changes. However, when looking a bit closer at the objects involved, I notice that my pixmap and bitmap will not be unreferenced by this operation, i.e. their ref_count remain the same after this second drag_source_set_icon(), and the resources do not get freed as appropriate.

Is there another way to uninstall or unreference a pixmap/bitmap used as drag source icon?

On a somewhat related note, I'm also looking for a nice and simple way to render 1-bit data to a Gtk::Pixbuf, as this would be allow me to use another variant of the set method - one that's actually recommended by the manual... Help, anyone?

- Toralf





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