Re: X selections




Mark Volpe <volpe.mark@epamail.epa.gov> writes:

> I'm trying to get a CList to supply a selection, following the
> instructions in the tutorial (19.3). The tutorial refers
> to a function gtk_selection_add_handler, but there is no
> such function in any of the gtk/gdk header files, nor anything
> remotely similar in gtkselection.h. I do see functions like
> gtk_selection_add_target so maybe the mechanism changed.
> 
> Could someone please provide a quickie explanation on how
> to set up a selection handler?

>From docs/Changes-1.2.txt:

* The selection API has been slightly modified:

 gtk_selection_add_handler() and gtk_selection_add_handler_full() 
 have been removed. To supply the selection, one now register
 the targets one is interested in with:

  void gtk_selection_add_target (GtkWidget           *widget, 
                                 GdkAtom              selection,
                                 GdkAtom              target,
                                 guint                info);

 or:
  
  void gtk_selection_add_targets (GtkWidget           *widget, 
                                  GdkAtom              selection,
                                  GtkTargetEntry      *targets,
                                  guint                ntargets);

 When a request for a selection is received, the new "selection_get"
 signal will be called:

   void  "selection_get"           (GtkWidget          *widget,
                                    GtkSelectionData   *selection_data,
                                    guint               info,
                                    guint               time);

 A "time" parameter has also been added to the "selection_received"
 signal.

  void  "selection_received"       (GtkWidget          *widget,
                                    GtkSelectionData   *selection_data,
                                    guint               time);


Regards,
                                        Owen



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