ezkur / yad

Automatically exported from code.google.com/p/yad
GNU General Public License v3.0
0 stars 0 forks source link

Kill yad dialogue via YAD_PID #208

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
I'm trying to create a menu with several vertically aligned buttons. Since 
buttons created with "--button=*" can't be aligned vertically, I'm using 
"--form --field=button:BTN". However, I can't find a way to close the dialogue 
via these buttons. I'm trying "kill $YAD_PID" but YAD_PID always seems to be 
empty.

What is the expected output? What do you see instead?
yad --no-buttons --form --field='Close YAD':FBTN "kill $YAD_PID"
--this should close the dialogue, instead kill returns an error message, 
requesting a pid
yad --no-buttons --form --field='Close YAD':FBTN "echo $YAD_PID"
--this shows that YAD_PID is empty

What version of the product are you using?
0.26.1

Original issue reported on code.google.com by nicolai....@aol.de on 4 May 2014 at 1:02

GoogleCodeExporter commented 8 years ago
$YAD_PID is a shell variable and available ONLY in child SHELL. so, your 
example must be

yad --no-buttons --form --field='Close YAD':FBTN "/bin/sh -c "kill $YAD_PID"'

Original comment by ananasik on 4 May 2014 at 1:17

GoogleCodeExporter commented 8 years ago
Wow, that was fast! And it works too! Thank you very much!

Original comment by nicolai....@aol.de on 4 May 2014 at 1:54