[SOLVED] dialog --radiolist with list from file to choose not working
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to select one file at a time from this list, so I use the
Code:
dialog --radiolist
option. I think I've understood everything written in the manpage about dialog, but this isn't explained there. I've tried to number each line so I get a tag for each file to select, I've added the off/on statement for default setting of the radiobutton, I've tried several things with the --file option... I've checked how others do it (pkgtool, sbopkg and such scripts which use dialog together with lists) but I don't get it (it's too complex there for me to figure out). I've checked the format of the input file to dialog in the remove part of pkgtool and tried like this, no success.
I still think it's a formatting problem of my list.
Any ideas how this should be done?
Thank you
Last edited by wargus; 02-22-2012 at 06:53 PM.
Reason: typo
For the radiolist option, it should something as such:
Code:
dialog --backtitle "Test" --radiolist "Select option:" 15 35 3 \
1 "Test 1" off \
2 "Test 2" on \
3 "Test 3" off
I broke it up into sections to better understand. The 15 and 35 are height and width, respectively, the first 3 is how many options in your radio list, and then you can probably figure the rest out.
and it works it also works after I rewrote my create_list( )
Seems I tried too long last night and messed up something with my list and the format was not proper. I should go to sleep earlier
Thank you very much, I should have figured out myself
well I simply try to create a UI for a script which generates a 3D view from a gds-file (microchip layout). The command needs many arguments each time and it's annoying to type them every time. Additional to the gds-file it needs two special files, depending on the technology used in the gds. So I make the user chose it one by one, but I don't like the --fselect dialog so I was to list the content of a directory and pass it to the --radiolist dialog. At the end I messed up the format of the input file.
I am teaching myself shell scripting and any input from other scripts is welcome, to learn and steal a bit Mostly, big scripts are not easily readable for me because of the many nested variables they contain and the lack of in-script documentation.
This is a snippet from a cdripping script that needs a variable length checklist, $DIALOGDATA contains the options for each check button ( 1 "Test 1" off ... in your example above .
P.S.
quotes should be escaped like so
Code:
DIALOGDATA="1 \"Test 1\" off 2 \"Test 2\" on 3 \"Test 3\" off"
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.