Re: Storing a pointer in Gtk::SelectionData
- From: "Milosz Derezynski" <internalerror gmail com>
- To: "Johannes Schmid" <jhs jsschmid de>
- Cc: gtkmm-list gnome org
- Subject: Re: Storing a pointer in Gtk::SelectionData
- Date: Sat, 26 Apr 2008 15:20:34 +0200
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());
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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]