LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2024, 03:10 AM   #1
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623
Blog Entries: 40

Rep: Reputation: Disabled
[yad] Unable to set default for very last of several check-boxes


Good morning

I have a yad script, creating a dialog with several check-boxes, all set to true initially. The very last one cannot adopt that value.

Is this a bug in your opinion or something I have to know? Having split the field definitions to 1 line per field, I notice that the position of the closing parenthesis ( "))" ) is of importance, else the return value from the dialog is unusable.

Such sensibility is awkward but maybe I am overlooking something.
(That was due to a typo)
The screen shot of the current dialog, authentic, from the below script: https://www.linuxquestions.org/quest...1&d=1706346853

I still have to verify its usability in the context of a little project.

Code:
#!/bin/bash
#/***************************************************************************
# *   ©2024-2024, Michael Uplawski <michael.uplawski@uplawski.eu>           *
# *                                                                         *
# *   This program is free software; you can redistribute it and/or modify  *
# *   it under the terms of the WTFPL 2.0 or later.                         *
# *                                                                         *
# *   This program is distributed in the hope that it will be useful,       *
# *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
# *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                  *
# *                                                                         *
# ***************************************************************************/

# A dialog to override configuration options

TITLE="Override post-processor configuration"
# Apart from PP, these are the configuration variables which can be
# manipulated or rather unset.
PP=1
GROUP_SIGS=2
CUSTOM_HEADERS=3
XNAY_GROUPS=4
DEBUG_LOG=5
CONF=($(yad --item-separator=" " --title "$TITLE" --image="" --window-icon="" --form \
		--field="Uncheck to disable options":LBL\
		--field="Post Processor (disable all)":CHK 'true'\
		--field="Signature":CHK 'true' \
		--field="Custom-headers":CHK 'true' \
		--field="XNAY":CHK 'true' \
		--field="Log":CHK 'true'))

IFS="|"
read -ra C_ARR <<< $CONF
CONF=''
# TODO : comment or remove
# ------------->
echo ${C_ARR[@]}
# <-------------

for i in PP GROUP_SIGS CUSTOM_HEADERS XNAY_GROUPS DEBUG_LOG
do  
        if [ 'FALSE'==${C_ARR[$i]} ]
		then
				CONF="$i $CONF"
		fi
done
# signal the fields
echo $CONF
Attached Thumbnails
Click image for larger version

Name:	sc.png
Views:	13
Size:	54.1 KB
ID:	42476  

Last edited by Michael Uplawski; 01-27-2024 at 03:54 PM. Reason: typing mistake "==" !!!
 
Old 01-27-2024, 08:47 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,156

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
Why no space after the final 'true'?
 
Old 01-27-2024, 08:55 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,781

Rep: Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935
I don't know why but yad expects a field for true/false even for the label.
Code:
 --field="Uncheck to disable options":LBL ""\
 
1 members found this post helpful.
Old 01-27-2024, 03:49 PM   #4
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623

Original Poster
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
I don't know why but yad expects a field for true/false even for the label.
Code:
 --field="Uncheck to disable options":LBL ""\
It looks like this is the “solution” to the checkbox problem. I will not dwell on the other phenomenon that I have struck out, above. But there appear to be more oddities with the YAD syntax. I can live with the current version.

Thank you very much, Michael
 
Old 01-27-2024, 03:52 PM   #5
Michael Uplawski
Senior Member
 
Registered: Dec 2015
Posts: 1,623

Original Poster
Blog Entries: 40

Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Why no space after the final 'true'?
Difficult to answer. It does not make a difference and I think I have tried all kinds of variations to fill the checkbox. An empty value for the LBL field creates the dialog that I want.
 
  


Reply

Tags
boolean, last checkbox, yad



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Get first day of last month and last day of last month in bash xowl Linux - Software 18 02-09-2017 09:49 AM
Want to install yad. Can't seem to even add the repository honest_abe Linux - Software 8 05-03-2015 10:57 AM
LXer: Multiple-item data entry with YAD LXer Syndicated Linux News 0 04-07-2014 11:51 AM
[SOLVED] How to debug undefined reference to library function (yad 0.5.1)? catkin Linux - Software 3 10-17-2010 07:08 AM
A very very very very big problem!! Elbryan Linux - Software 2 09-23-2005 05:56 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration