View Full Version : dragCallback flag from textScrollList not working?
03 March 2011, 06:38 AM
I've tried using drapCallback & dropCallback flag from textScrollList but it it seems that the drapCallback is not working. Consider this example (this code snippets are mostly taken from http://www.naughtynathan.co.uk/?p=308):
string $win = "dragDropTestWindow";
if (`window -exists $win`) deleteUI -window $win;
window -title "Drag/Drop Window" $win;
columnLayout -adj 1 -rs 5;
button -h 50 -l "Drag Me!" -dgc "dragCallBack";
button -h 50 -l "Drag/Drop Here!" -dgc "dragCallBack" -dpc "dropCallBack";
separator -h 20;
textScrollList -h 80 -dgc "dragCallBack" -dpc "dropCallBack";
window -e -wh 200 300 $win;
global proc string dragCallBack(string $dragCtrl,int $x, int $y, int $mods)
print ("dragCallBack - Drag control: "+$dragCtrl+"\n");
global proc dropCallBack(string $dragCtrl, string $dropCtrl, string $msgs,
int $x, int $y, int $type)
string $text = "dropCallBack:\n";
$text += (" Drag control: "+$dragCtrl+"\n");
$text += (" Drop control: "+$dropCtrl+"\n");
$text += (" messages: ");
$text += `stringArrayToString $msgs ", "`;
confirmDialog -m $text;
the textScrollList successfully received dragged messages from buttons above, but failed if I tried to drag from the TSL. Am I using it wrong or this is a bug?
nb : Tested in Maya2009 & 2011 Linux.
03 March 2011, 10:20 AM
hey Jefri, I tried your posted code exactly as is and it worked fine...? I could MMB-drag from the TSL onto the drop button (or drop back onto itself!) and I got the dialog telling me what I'd done..? I'm on Win7, 2010 32bit, but I find it hard to believe it works in 10 but not 9 or 11... maybe it's a windows/linux issue?
I take it you are testing this exact code too, and it's not a reduced snippet from some other, bigger code? you're not trying to drag highlighted items or something more sophisticated are you? you can only drag the whole control...
03 March 2011, 11:47 AM
Hi Nathan, Yeah I did tried the same exact code as I posted above (taken from your blog, i'm sure you noticed it :D ). I've also tested the code on winxp, and the results were pretty intriguing... using Maya 2009 it worked fine, but with Maya 2011, it's working, but only when I carefully dragged the mouse exactly from the edges of the TSL. When I dragged from the list (as people usually do), it did not trigger the drag/drop commands. In Linux, it failed it both version (or behaving like Maya2011 winxp, i'm not sure).
03 March 2011, 02:41 PM
If Maya UI had a face I would punch it hard, especially 2011's... in 2011 they seem to have "broken" about 50% of the (admittedly) obscurer aspects of UI handling/creation...
I do know that certain UI controls don't correctly handle drag/drop (i.e. text/input fields) because they inherrently handle some other system-based methods of drag/dropping, so maybe textScrollList is one such retarded bastard hybrid...?
03 March 2011, 03:31 AM
Yeah, though I applaud them for bringing QT UI into maya(especially in Linux, it's relieving
not having to deal with that stone-aged motif ui anymore), the 2011 version is so clunky i hardly believe anyone really uses it in large-scale production. Hopefully the new version fill "fix" most of these UI problems.
03 March 2011, 03:31 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.