Signaux
Quand une destination a accepté un élément glissé, certains signaux vont être émis selon l'action choisie. Par exemple, l'utilisateur peut avoir maintenu enfoncée la touche Maj pour indiquer un déplacement plutôt qu'une copie. Souvenez-vous que l'utilisateur ne peut sélectionner que les actions définies dans vos appels à drag_dest_set() et drag_source_set().
- XVII.III.I. Copie
- XVII.III.II. Déplacement
XVII.III.I. Copie
The source widget will emit these signals, in this order:
- drag_begin: Provides a Gdk::Drag.
- drag_data_get: Provides a Gdk::Drag, and a Gtk::SelectionData object, in which you should put the requested data.
- drag_end: Provides a Gdk::Drag.
The destination widget will emit these signals, in this order:
- drag_motion: Provides a Gdk::Drop and coordinates. You can call the status() method of the Gdk::Drop to indicate which action will be accepted.
- drag_drop: Provides a Gdk::Drop and coordinates. You can call drag_get_data(), which triggers the drag_data_get signal in the source widget, and then the drag_data_received signal in the destination widget.
- drag_data_received: Provides a Gdk::Drop, and a Gtk::SelectionData object which contains the dropped data. You should call the finish() or failed() method of the Gdk::Drop to indicate whether the operation was successful.