PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

GtkWidget::drag_dest_set | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

GtkWidget::drag_dest_set

void drag_dest_set( GtkDestDefaults flags , array targets , GdkDragAction actions );

Sets the calling widget as a drag-and-drop destination. flags is one of four GtkDestDefaults values which define how the widget reacts when the drag is over the widget.

The targets parameter defines a list with all data types which can be dropped over the widget. The parameter is an array of arrays of size three:
$targets = array(
//array( target, flags, info),
  array( 'text/plain', GTK_TARGET_SAME_APP, 0),
  array( 'text/uri-list', 0, 1)
);
In our example, the widget would accept textual data and files. The files could be dragged from everywhere (flag parameter 0), but the textual data are only accepted if they come from within our application.

It is not possible to use a "*" mime type in the target.

The flags of the targets determine from which widget the drag has to come from:

表 9. Values for flags

0Accept drags from everywhere.
GTK_TARGET_SAME_APPAccept drags only from widgets of the same application only.
GTK_TARGET_SAME_WIDGETAccept drags only from the same widget. This is useful for e.g. moving items up/down in a list by dragging them.

info allows you to pass a number to the function connected to the "drag-data-received" signal. This is useful when e.g. allowing multiple image types to be dropped, as well as some other non-image types: All image types could be assigned "1" as info parameter, all other types "2" or so. In the drag received function could pass the necessary data to a image open function by checking if the info parameter is "1", without having to compare the mime type.

See also: drag_dest_unset()

忘却曲線を使ってこの知識を確実に記憶に残す

フォーラムで「GtkWidget::drag_dest_set」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | GtkWidget::drag_dest_set」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: