RE: [gtkmm] Purpose of Gtk::TargetEntry



Please see below.

> -----Original Message-----
> From: Ohrnberger, Erik
> Sent: Tuesday, November 04, 2003 11:24 AM
> To: Ohrnberger, Erik
> Subject: RE: [gtkmm] Purpose of Gtk::TargetEntry
>
>
> Ohrnberger, Erik wrote:
> > The drag and drop example uses this:
> >
> > //Targets:
> > m_listTargets.push_back( Gtk::TargetEntry("STRING", 0,
> > TARGET_STRING) );
> > m_listTargets.push_back( Gtk::TargetEntry("text/plain", 0,
> > TARGET_STRING) );
> > m_listTargets.push_back(
> > Gtk::TargetEntry("application/x-rootwin-drop", 0,
> > TARGET_ROOTWIN) );
> >
> > It sounds like the source widget's target entries set in the
> > drag_source_set
> > call are being matched to the drop site's target entries set in the
> > drag_dest_set call, and that the first string entry needs to
> > match in order
> > for the dest widget to accept the drop. (Have I got all that
> > correct in my
> > mind?)
>
> Yes, but it doesn't need to be the "first" one.
>
> > If that's the case, would it make sense for sources to list their
> > application class name for example, and have the
> destinations with the
> > larger list of names of what they can accept?
>
> I don't understand. Do you meant that it should be
> "murrayapp" instead of
> "STRING"? Or in addition to the existing ones?
>
> > Just seems like the example given leaves some of this aspect
> > of D&D rather
> > ambiguous, and I believe that there is some real powerful filtering
> > capabilities in there, just need a little more info. to make
> > use of them.
>
> I'm fairly sure it can be better, but I'm not sure what you
> are suggesting.

Yes.  This is what I was trying to say.  That the strings in the target
entries are like filters or selectors of what the drop target can accept
and process, while each drag srouce provides it's string name for matching
with what the target can accept.

>
> By the way, it is already a bit nicer in gtkmm 2.4 because it
> uses more C++
> types there and has more convenient method overloads.
>

Cool.  I look forward to it.  I take it it's not released just yet.

> Murray Cumming
> www.murrayc.com
> murrayc usa net
> _______________________________________________
> 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]