I developp a software in linux and i have problem, i have a primary yad window (for this exemple i use the name : w1) and button who execute an second : w2, w2 is list and i want to export the selected line, how I could extract the selected line from the function (knowing that I get there halfway but I can't get my line out of my function), my code :
w1=$(yad --title="TITLE"\
--form \
--no-escape \
--center \
--window-icon=gtk-preferences \
--borders=10 \
--fixed \
--text="TEST" --text-align=center \
--button="LIST`!format-justify-fill:bash -c w2 && echo $w2" \
--button="`QUIT`"!gtk-quit:1 )
w2 ()
{
INPUT="MY FILE WITH ALL DATA"
item=$(while read l
do
echo "$l"
done <$INPUT|yad --title="TITLE 2"\
--borders=10 \
--listen \
--no-markup \
--width=500 \
--height=500 \
--no-escape \
--center \
--window-icon=gtk-preferences \
--list \
--column="COLUMN 1":text \
--column="COLUMN 2":text \
--button=""!go-jump:1 \
--button="QUIT"!go-jump:1)
}
export -f w2
In this case, the variable $item contain the result.