OxyScripts.com
Menu spacer Home Tutorials Articles Code Forums irc.freenode.net #oxyscripts
Main (PHP)
Home Forums PHP News PHP Tutorials Articles PHP Code Snippets Contact Us Sysadmin Resources Books Template Shop
3rd Party Streams
SlashDot PHPDeveloper.org PHP.Net
Resources
PHP Manual MySQL Manual Smarty Manual PEAR Manual PHP-GTK Manual Symfony Manual
Code Snippets
Authentication Database Graphics HTTP Miscellaneous Time/Date
Affiliates
Scripts TutorialMan TutorialGuide CodingForums.com PHP Scripts Cheap Web Hosting Affordable Web Hosting Dreamweaver Templates

Search This Site :     PHP Function Reference :
 
GtkWidget::drag_dest_set

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:

Table 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()

 
   Print this page

Top Sponsor
Symantec\'s Norton SystemWorks 2006
Sponsors
CA
Sponsors
AdWords Dominator 125*125
Advertisting

Affiliates
VertexTemplates PHPFreaks CodeWalkers StarGeek DevScripts CGI & PHP Scripts PHP CMS

Shopping Rebates   Sell It 4 You   Flash Page Counters   Get Insured
GPS Tracking Service   Charity Donate Info   Web Site Hosting   VOIP Service

Privacy Policy | Links | Site Map | Advertising

All content on OxyScripts.com is (©)2002-2007

 
Powered by Adrastea - Version 1.0.0. Copyright © Rune Solutions, 2004-2005