Signály

Když cíl pro upuštění přijme přetahovanou položku, jsou vyslány některé signály, podle toho, jaká akce byla vybrána. Například, uživatel může držet zmáčknutou klávesu Shift, aby řekl že chce přesouvat a ne kopírovat. Pamatujte, že uživatel může vybrat jen akci, kterou jste určili ve svém volání metod drag_dest_set() a drag_source_set().

17.3.1. Kopírování

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.

17.3.2. Přesun

During a move, the source widget will also emit this signal:

  • drag_data_delete: Gives the source the opportunity to delete the original data if that's appropriate.