Yad checklist items with different image?

368 views
Skip to first unread message

Rasat

unread,
Mar 1, 2022, 2:38:09 PM3/1/22
to yad-common
Hi,
I am creating one Fvwm extension installer with "yad --checklist --list". Each checklist item has a different image. My question is, can "--image" option be used multiple times? To change the image when highlighting a checklist item. If not, any other options to use?

Here below are a few of the checklist items with the images. Only the last image on the list is shown on the left side of dialog.

#####
#!/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 \

#######

Screenshot:

extension-Installer.png

Markku

Misko

unread,
Mar 1, 2022, 6:37:40 PM3/1/22
to yad-common
[quote=rasat]can "--image" option be used multiple times?[/quote]
No, image option is used only once.
There is --picture dialog but no way to change the image.

You didn't write which version of Yad you have.

yad --version
10.90 (GTK+ 3.24.24)

Something like next would work for me:

#!/bin/bash

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

key=$RANDOM

yad --plug=$key --tabnum=1 \
    --select-action='bash -c "split_arg %s"' \
    --hide-column=6 \
    --title="Extension Installer" \
    --list  --checklist \
    --width=900 --height=650 \
    --separator="\n" \
    --column="pick" \
    --column="Num" \

    --column="Ext type" \
    --column=Extension \
    --column=Description \
    --column="" \          # hidden column 6
    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" \
| yad --plug=$key --tabnum=2 \
      --list --no-headers \
      --listen --cycle-read \
      --column=":IMG" &

yad --paned --key=$key --center --orient=Horizontal --splitter=500 --width=800 --height=600




There are two lists. The text in a 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.
Instead of  --select-action, --dclick-action (doble click) can be used. You can set the splitter accordingly to match the size of the images.
It kind of works.

Julio C. Neves

unread,
Mar 2, 2022, 7:26:52 AM3/2/22
to yad-c...@googlegroups.com
YAD allows you to declare a list with a field of type :IMG and in it, present the icons or images of the current icon theme in GTK+, associated with the other fields of the list. The size of these images can be specified in the configuration file. This greatly improves aesthetics and visualization. Fields of this type are output and therefore must be filtered, via Shell or via the --print-column option.
For example, this command:
yad --list --column "Clique:IMG"        \
    --column "Para"                     \
    --image input-mouse                 \
    --width 250 --height 130            \
    utilities-terminal Terminal         \
    preferences-desktop-accessibility Acessibilidade
Produces:
image.png

I want to remind everyone that our fellow who developed YAD and follows this list without leaving any questions unanswered, Victor Ananjevsky, is Ukrainian and lives there.
Abraços,
Julio
» Aprenda Shell e seja o melhor admin da sua empresa
» Curso no formato presencial ou EAD com aulas ao vivo

Nossos treinamentos te certificarão e podem ser
em sua cidade. Nossa empresa é 100% regulamentada.



--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/yad-common/54ff08be-df9b-4006-b751-beb934ebb162n%40googlegroups.com.

Julio C. Neves

unread,
Mar 2, 2022, 7:31:51 AM3/2/22
to yad-c...@googlegroups.com
Sorry, I didn't understand the question and I gave a wrong answer

Abraços,
Julio
» Aprenda Shell e seja o melhor admin da sua empresa
» Curso no formato presencial ou EAD com aulas ao vivo

Nossos treinamentos te certificarão e podem ser
em sua cidade. Nossa empresa é 100% regulamentada.


@rasatPC

unread,
Mar 2, 2022, 9:05:47 AM3/2/22
to yad-c...@googlegroups.com

> Something like next would work for me:

Thank you for the reply.

yad --version
10.1 (GTK+ 3.24.30)

Does the version make a difference? For some reasons, I cannot get the dialog box to appear.

--
You received this message because you are subscribed to a topic in the Google Groups "yad-common" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/yad-common/pdd3aULni4A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to yad-common+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/yad-common/c47f3425-d87c-4dd3-b8c7-8e14290de306n%40googlegroups.com.

@rasatPC

unread,
Mar 2, 2022, 8:03:27 PM3/2/22
to yad-c...@googlegroups.com
Manage to get the dialog to appear, looks good. Still is missing the
image, doesn't appear in the right side tab. The --column=":IMG" doesn't
find the images. Any help?

###

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

key=$RANDOM

yad --plug=$key --tabnum=1 \
--select-action='bash -c "split_arg %s"' \
--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" &
yad --paned --key=$key --title="Extension Installer" \
--center --orient=Horizontal --splitter=500 --width=800 --height=600

########

extension-Installer2.png

Misko

unread,
Mar 2, 2022, 10:15:33 PM3/2/22
to yad-common

Rasat

unread,
Mar 3, 2022, 4:56:41 AM3/3/22
to yad-common
> Use a named pipe (FIFO)

THANK YOU, this is great. I posted this same question on a few other forums but no answer. Good to know where to ask next time. Also, to share interesting solutions.

Markku

@rasatPC

unread,
Mar 6, 2022, 5:10:39 AM3/6/22
to yad-c...@googlegroups.com
> --column=@font@

How to change the fonts in column 4 to bold?


Misko

unread,
Mar 6, 2022, 8:37:34 AM3/6/22
to yad-common
--column="@font@"
is used to set the font of rows
# -----------------------------_______------------------------------------------____-----------------__----------------------_____------------------
yad --list --column="@font@" --column="" --column="" "bold" row bold "" row not_bold "italic" row italic

To set the column bold use the pango markup language on  each column entry.

yad --list --column="" --column="" row "<b>bold</b>" row "<b>bold_text</b>" row "<b>bold text</b>"

Rasat

unread,
Mar 6, 2022, 12:34:40 PM3/6/22
to yad-common

> To set the column bold use the pango markup language on each column entry.

Thanks. It would be good to update the Yad man page with this (pango markup) information. For the record, this is what I did in column 4. Lools good

####
false   402    Bindings         "<b>My Key Binding</b>"     "Short description."
false   501    Decorations    "<b>Diary Decor</b>"           "Based on addy-fe's Diary theme."
####

Reply all
Reply to author
Forward
0 new messages