yad --list --select-action fired multiple times if list is cleared

527 views
Skip to first unread message

Zach Miri

unread,
Apr 22, 2016, 3:02:18 AM4/22/16
to yad-common
If the --list is cleared and repopulated, the --select-action event is triggered multiple times as the list is repopulated. Any way to disable this and make it so the --select-action event is only triggered if the user selects and item on the list? Thanks.

#!/bin/bash -a

mkfifo ${fifo=$(mktemp -u)}
exec {fd}<>${fifo}

dbl () {
echo double event - $1
printf '\f\n' > $fifo
printf "1\n2\n3\n4\n5\n" > $fifo
}

sel () {
echo select event - $1
}

yad \
--list \
--listen \
--dclick-action 'bash -c "dbl %s"' \
--select-action 'bash -c "sel %s"' \
--column 'A' 1 2 3 4 5 < $fifo

IF THE NUMBER 1 IS DOUBLE CLICKED, THE SELECT EVENT IS FIRED MULTIPLE TIMES AS THE LIST IS POPULATED
select event - 1
double event - 1
select event - 2
select event - 2
select event - 3
select event - 3
select event - 4
select event - 4
select event - 5

select event - 5

Zach Miri

unread,
Apr 22, 2016, 5:51:30 PM4/22/16
to yad-common
Actually, this better describes the problem.

Sending a clear to the list ( echo -e '\f' ) causes the --select-action to fire for each of the current items in the list.

A simpler example:
(sleep 5; echo -e '\f') | yad --list --listen --select-action 'echo select event %s' --column 'A' {1..10}

select event 1
select event 2
select event 2
select event 3
select event 3
select event 4
select event 4
select event 5
select event 5
select event 6
select event 6
select event 7
select event 7
select event 8
select event 8
select event 9
select event 9
select event 10
select event 10

Zach Miri

unread,
Apr 26, 2016, 10:28:21 AM4/26/16
to yad-common
Also, I noticed that this problem only occurs when yad is compiled with gtk3 and not gtk2.

Zach Miri

unread,
Jun 15, 2016, 4:33:32 AM6/15/16
to yad-common
Victor, when yad is built with GTK3, sending a clear to the list ( echo -e '\f' ) causes the --select-action to fire for each of the items in the list (see below). This does not happen when yad is built with GTK2 (see below). Can you make GTK3 behave like GTK2? I am not able to clear the list with GTK3 due to the extra --select-actions being fired. Thanks.

BUILD WITH GTK2
(sleep 5; echo -e '\f') | src/yad --list --listen --select-action 'echo select event %s' --column 'A' {1..10}
select event 1

BUILD WITH GTK3
(sleep 5; echo -e '\f') | src/yad --list --listen --select-action 'echo select event %s' --column 'A' {1..10}
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

Julio C. Neves

unread,
Jun 17, 2016, 4:08:09 AM6/17/16
to yad-c...@googlegroups.com
I'm using GTK2.

$ (sleep 5; echo -e '\f') | yad --list --listen --select-action 'echo select event %s' --column 'A' {1..10}
select event 1
select event 2
select event 2
select event 3
select event 3
select event 4
select event 4
select event 5
select event 5
select event 6
select event 6
select event 7
select event 7
select event 8
select event 8
select event 9
select event 9
select event 10
select event 10

Imagem inline 1

Abcs,
Julio
@juliobash

P
róximos cursos de Shell
Cidade         Local Período
São Paulo 4Linux 25
-29/07
Dou treinamento de Shell em qualquer cidade.
Para mais detalhes, me mande um e-mail.


--
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.

Zach Miri

unread,
Jun 17, 2016, 4:31:56 AM6/17/16
to yad-common
Really? That's unusual, can you post your "yad --version" with associated GTK version as I have done below.

BUILD WITH GTK2
yad --version
0.36.3 (GTK+ 2.24.28)
(sleep 5; echo -e '\f') | src/yad --list --listen --select-action 'echo select event %s' --column 'A' {1..10}
select event 1

BUILD WITH GTK3
yad --version
0.36.3 (GTK+ 3.14.13)

Victor Ananjevsky

unread,
Jun 17, 2016, 5:20:55 AM6/17/16
to yad-c...@googlegroups.com

please, check the latest svn

В Fri, 17 Jun 2016 01:31:55 -0700 (PDT)
Zach Miri <linuxo...@gmail.com> писал:

> Really? That's unusual, can you post your "yad --version" with associated
> GTK version as I have done below.
>
> *BUILD WITH GTK2*
>
> *yad --version0.36.3 (GTK+ 2.24.28)*
> (sleep 5; echo -e '\f') | src/yad --list --listen --select-action 'echo
> select event %s' --column 'A' {1..10}
> select event 1
>
> *BUILD WITH GTK3*
>
> *yad --version0.36.3 (GTK+ 3.14.13)*
> (sleep 5; echo -e '\f') | src/yad --list --listen --select-action 'echo
> select event %s' --column 'A' {1..10}
> Gtk-Message: GtkDialog mapped without a transient parent. This is
> discouraged.
> select event 1
> select event 2
> select event 2
> select event 3
> select event 3
> select event 4
> select event 4
> select event 5
> select event 5
> select event 6
> select event 6
> select event 7
> select event 7
> select event 8
> select event 8
> select event 9
> select event 9
> select event 10
> select event 10
>
> --
> 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>

Zach Miri

unread,
Jun 17, 2016, 6:27:05 AM6/17/16
to yad-common
Victor, with the new version, the --select-action stops working after the list is cleared for the first time (see new example below).

(sleep 5; echo -e '\f\n1\n2\n3\n4\n5') | yad --list --listen --select-action 'echo select event %s' --column 'A' {1..10}

Victor Ananjevsky

unread,
Jun 17, 2016, 6:34:25 AM6/17/16
to yad-c...@googlegroups.com
fixed

В Fri, 17 Jun 2016 03:27:05 -0700 (PDT)
Zach Miri <linuxo...@gmail.com> писал:

Zach Miri

unread,
Jun 17, 2016, 6:51:32 AM6/17/16
to yad-common
It works great now. Thanks! 

Julio C. Neves

unread,
Jun 17, 2016, 7:26:46 AM6/17/16
to yad-c...@googlegroups.com

I forgot to do that. Now I am using a cell phone, in a train, traveling in vacations to another coutry (italy).
As soon as I login again i'll do that.

--
Reply all
Reply to author
Forward
0 new messages