Open pkzc opened 1 month ago
I believe all --field
types take a value, LBL
included.
With yad 14.1, this creates a messed up field set: ... Pressing '+', A/H counts up to 59, A/M and T/M count up infinitely.
I think '0!0..23' becomes the LBL
's value, leaving '0!0..59' for the A/H counter...
yad --form \
--columns=2 --align=center \
--field=A:LBL \
--field=H:NUM '0!0..23' \
--field=M:NUM '0!0..59' \
--field=T:LBL \
--field=M:NUM '0!0..1440'
However, this one works as expected:
That's because ''
becomes the LBL
's value, so the remaining values go to the respective owners.
I believe that the fact that an LBL field requires two arguments similarly to NUM fields is not documented anywhere. Or there is a bug somewhere.
I don't think it says anywhere that the LBL field takes only one argument instead of two but I could be wrong. Did you read anywhere that it does? I think that would be a documentation bug.
In the man page I can see the wording "initial value..." in several places where second arguments of various fields are described, e.g. for NUM, but for LBL it, or any similar indication, is missing. This may be regarded as misleading.
On the other hand, it occured to me, that the second argument of LBL could be truly useful. Now, in the |-separated answer, I get an empty string in the place of the LBL field even if I supply a non-empty string as a second argument, but in some situations it could be useful to get back that string in the answer -- for example when writing a general processing function of the answers from several forms.
$ echo $(yad --form \
--columns=2 --align=center \
--field=A:LBL 'L1' \
--field=H:NUM '1!0..23' \
--field=M:NUM '2!0..59' \
--field=T:LBL 'L2' \
--field=M:NUM '3!0..1440')
|1|2||3|
Or, might this be the real bug?
...it occured to me, that the second argument of LBL could be truly useful...
I agree.
Or, might this be the real bug?Or, might this be the real bug?
Currently, it appears to be intentional for the BTN
, FBTN
and LBL
field types to output as empty strings.
This is the relevant source code https://github.com/v1cont/yad/blob/c3c75f9a2886fbf35ba5edbcd9f0654a99d3eea4/src/form.c#L1552.
OK, I see. BTN and FBTN are all right, they are reflected in the returned status, but you might consider including the LBL value in the answer string. It's a field, after all, isn't it? And in any case, perhaps, adding to the man page that LBL requires an initial value, at least an empty string currently.
I have also another improvement proposal, I will file a separate ticket for that.
cheers PK
Just to be clear, I'm not the author of yad.
Ah, OK. I hope the author or someone active also reads this issue tracker. Or do you happen to know if there is a better place to submit yad issues?
This is the place to submit issues.
With yad 14.1, this creates a messed up field set:
Pressing '+', A/H counts up to 59, A/M and T/M count up infinitely.
However, this one works as expected:
I believe that the fact that an LBL field requires two arguments similarly to NUM fields is not documented anywhere. Or there is a bug somewhere.