#!/bin/bash
id="12345"
fsAction="myProgram --starts --with"
yad --plug="$id" --dnd --tabnum="1" --text="sigWhite" --command="echo ${fsAction} --sigWhite" &
yad --plug="$id" --dnd --tabnum="2" --text="sigBlack" --command="echo ${fsAction} --sigBlack" &
#yad --plug="$id" --dnd --tabnum="3" --text="sigWhiteRight" --command="echo ${fsAction} --sigWhite --sigRight" &
#yad --plug="$id" --dnd --tabnum="4" --text="sigBlackRight" --command="echo ${fsAction} --sigBlack --sigRight" &
yad --paned --key="$id" --title="Panel 2 x 2"
What I call a "drop-area" could be whatever control does the job: field, button, dnd, .... don't know.It is very important that I could drag-and-drop files rapidly to these "drop-areas" without further interaction.
I prototyped the desired behaviour with 4 different yad-scripts which bring up 4 yad-dialogs. I gave those 4 dialogs different titles, certainly suggesting the parameter set of choice to be used when a file or multiple files are being dropped on this dialog.
Here is a draft of one of those 4 dialogs I use to date (which is unsatisfying) - simple "--dnd" and "while read ..." works as expected:
#!/bin/bash
baseName="$(basename $0)"
fsProgram="${baseName:0:4}-force-${baseName:5}"
yad --dnd --width="400" --height="100" --title="${baseName}" | while read line
do
path="${line##file://}"
echo "fsProgram: ${fsProgram}, path: ${path}"
${fsProgram} "${path}"
done
id="${RANDOM}"
yad --plug="$id" --tabnum="1" --dnd --text="text 1" --text-align="center" --command="xdg-open" &
yad --plug="$id" --tabnum="2" --dnd --text="text 2" --command="xdg-open" &
yad --plug="$id" --tabnum="3" --dnd --text="text 3" --command="xdg-open" &
yad --notebook --key="$id" --tab="set 1" --tab="set 2" --tab="set 3" --width="400" --height="400" --button="gtk-quit:1" --button="gtk-ok:0"