Re: Storing a pointer in Gtk::SelectionData



Actually this is wrong, it should be sizeof(gpointer*).

2008/4/26 Milosz Derezynski <internalerror gmail com>:
(sorry for the resend Johannes)

This:


   gpointer your_pointer;
   Gtk::SelectionData::set ("your-type-name", 8, static_cast<guint8*>(&your_pointer),
   sizeof(your_pointer))

should do it. When getting it you just use:


   gpointer * your_pointer = static_cast<gpointer*>(Gtk::SelectionData::get_data());


2008/4/26 Johannes Schmid <jhs jsschmid de>:
Hi!

Probably a silly question, but how can I savely store a pointer to an
object in a Gtk::SelectionData. I guess I have to use

Gtk::SelectionData::set (int format, guint8* data, int length)

somehow but I cannot figure out how to store a pointer there in a
portable and save way. I only want to use the SelectionData within one
application (no cross application drag & drop).

Thanks,
Johannes

_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
http://mail.gnome.org/mailman/listinfo/gtkmm-list





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