Quite simple!
here is an example:
Item to drag:
window;
formLayout form;
text -al right
-l ("Test")
-dgc "dragText";
showWindow;
Item to drop:
window;
formLayout form;
text -al right
-l ("Test")
-dpc "dropText";
showWindow;
Drag&Drop Procedures:
global proc string[] dragText( string $dragged, int $x, int $y, int $mods )
{
string $result[1];
$result[0] = "text";
return $result;
}
global proc dropText ( string $dragged, string $drop, string $msgs[], int $x, int $y, int $type )
{
print("$dragged: " + $dragged + " $dropped: " + $drop + "n");
if( $dragged == $drop ) return;
if( size($msgs) < 1 ) return;
if( "text" != $msgs[0] ) return;
print("Drag&Drob successfull !!!n");
}
Hope that helps...
But I have another question!!!
I found out that not all MEL objects in Maya are drag&dropable. For instance I can drag text but I can't drag tabs athough the -dpc and the -dgc flag are available for almost all objects, layout, etc...
Does anyone have any experience with that problem?
Cheers
HumHum