yad | dnd | paned :: in need of some support, please!

1,060 views
Skip to first unread message

Karli Knallfrosch

unread,
Sep 5, 2016, 10:12:32 AM9/5/16
to yad-common
The following simple script yields a dialog with 2 active dnd areas. When I drag-and-drop a file from a file selector on either area, the appropriate message appears. This is the intended behaviour.

What I don't get is, why yad stops working and freezes as soon as I activate tabnum "3" and/or "4" which are shown here commented.
#!/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"

Finally, I need a panel (or whatever) with 4 separate dbd areas. Each area should execute a different command as soon as a filename or a list of filenames is being dropped.

Your help is much appreciated as I am a newbie and don't see the error in my code. I searchd this forum and the whole internet up and down and also tried different approaches even with pipes/fifos which are not needed for my current challenge.

Thanks in advance,
karli

Victor Ananjevsky

unread,
Sep 6, 2016, 8:57:50 AM9/6/16
to yad-c...@googlegroups.com

hi

only two panes can be added to paned dialog

i'll check what happens when more than two plugs exists for paned
dialog and why yad freeze in such case.

and please, describe the use case of what you need. maybe there is
another way to do the same


В Mon, 5 Sep 2016 07:12:32 -0700 (PDT)
Karli Knallfrosch <no....@party.ms> писал:
> --
> You received this message because you are subscribed to the Google Groups "yad-common" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to yad-common+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Victor Ananjevsky <anan...@gmail.com>

Karli Knallfrosch

unread,
Sep 6, 2016, 1:54:36 PM9/6/16
to yad-common
Hi Victor,

my use case is as follows:
  • drag-and-drop filename(s) from a standard system file manager (nautilus on Linux Mint in my case) to one out of four "drop-areas" on a yad dialog
  • each of these 4 "drop-areas" should immediately start a $SHELL command (see $fsAction below) with a given parameter set for the files being dropped
What I call "drop-area" here is what I thought the "--dnd --tabnum=1" would manage. Basically, I need 4 "drop-areas" to decide which parameter set should be attached to the command string ($fsAction):
  • drop-area 1 : starts script with parameter set 1
  • drop-area 2 : starts script with parameter set 2
  • drop-area 3 : starts script with parameter set 3
  • drop-area 4 : starts script with parameter set 4

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


Finally, I want to have 4 dialogs like this in one window, relized by, say, 4 "buttons" labeled with "set 1" ... "set 4" to which I can drop the file(s) in question.


I hope I made myself clear - I really tried to ;-)

Thanks for any help,
karli

serge gabellon

unread,
Sep 8, 2016, 2:27:36 AM9/8/16
to yad-common
Hello.
maybe use notebook option
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"



Reply all
Reply to author
Forward
Message has been deleted
0 new messages