Re: Storing a pointer in Gtk::SelectionData



On Sat, 2008-04-26 at 18:29 +0200, Murray Cumming wrote:
> On Sat, 2008-04-26 at 14:48 +0200, Johannes Schmid wrote:
> > 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).
> 
> GINT_TO_POINTER() and GPOINTER_TO_INT() might be useful.

thats what i thought too, but then i realized that set(...) takes
guint8* and the OP had somethingElse* ... there's no ptr/int cast
needed, just ptrToThis cast to ptrToThat. i know why we have guint8* in
there (thanks X11 DnD protocol spec!), but really void* would be better.

--p




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