You are not logged in.

#1 2022-02-28 17:01:42

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,293
Website

YAD --image option ?

I am creating one extension installer with YAD. Each checklist item (includes type, name, description, etc.) has an attached image. Cannot get the option "--image" to change the image when highlighting an checkbox item. Shows only the last one in the list.
My question is, can "--image" option be used multiple times or only once? If once, any other options??

#!/bin/bash
yad --title "Extension Installer" --checklist --list --width=900 --height=650 --separator=, --column=Y/N --column=No: \
--column="Ext type" --column=Extension --column=Description \

false 101 Functions "Auto Hide List" "Short description." --image=auto-hide.png \
false 102 Functions "Auto Move Windows" "Short description." --image=auto-move.png \
false 201 Styles "Diary Border Style" "Short description." --image=diary-style.png \
false 202 Styles "DiaryThumbnails" "Short description."  --image=diary-thumb.png \

extension-Installer.png

Last edited by rasat (2022-02-28 19:14:51)


Markku

Offline

#2 2022-03-03 11:15:48

rasat
Forum Fellow
From: Finland, working in Romania
Registered: 2002-12-27
Posts: 2,293
Website

Re: YAD --image option ?

Got the solution from the Yad-Command Google Group. Now, each checklist item has its own image.
https://groups.google.com/g/yad-common

@Misko: "There are two lists. The text in hidden column 6 is sent to the second list through pipe and straight to the column of type IMG. The fuction split_arg sends a form feed character to reset the second list and print the path of the image".

#!/bin/bash

split_arg () {
 echo -e "\f"
 echo "$6"
}
export -f split_arg

export fpipe="$(mktemp -u --tmpdir fvwmei.XXXXXXXX)"
mkfifo "$fpipe"
trap "rm "$fpipe"" EXIT
exec 3<> "$fpipe"

key=$RANDOM

yad --plug=$key --tabnum=1 \
    --select-action='bash -c "split_arg %s >$fpipe"' \
    --hide-column=6 \
    --list --checklist \
    --width=900 --height=650 \
    --column=Y/N --column=No: --column="Ext type" \
    --column=Extension --column=Description --column="" \
    false 101 Functions "Auto Hide List" "Short description." "auto-hide.png" \
    false 102 Functions "Auto Move Windows" "Short description." "auto-move.png" \
    false 201 Styles "Diary Border Style" "Short description." "diary-style.png" \
    false 202 Styles "DiaryThumbnails" "Short description." "diary-thumb.png" >inst.txt &
yad --plug=$key --tabnum=2 --list --no-headers --listen --cycle-read --column=":IMG" <&3  &

yad --paned --key=$key --title="Extension Installer" \
    --center --orient=Horizontal --splitter=500 --width=800 --height=600
    
exec 3>&-

exit

extension-Installer-th.png


Markku

Offline

Board footer

Powered by FluxBB