Refracta Development, Scripts, etc.
Post a reply
fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## zenity problems

Sun Dec 15, 2013 1:24 pm

Zenity does not like button definitions in a file-selection window.

Code:
  `zenity --file-selection --file-filter="*.[iI][sS][oO]" --file-filter="*" --width=640 --height=640 --title=$"Select Live ISO" --text="Select the CD image file." --filename="" --${BUTTON0}="OK"${BUTTON0NUM} -${BUTTON1}="Quit Task"${BUTTON1NUM}
  This option is not available. Please see --help for all possible usages.`

Remove the button options, and it works.
This partition selection window does not work with zenity. You can make a selection, but there's no output.

Code:
  `find /dev -mindepth 1 -maxdepth 1 -name "*[sh]d[a-z][1-9]" \
  > | grep $device | sort | awk '{print "\n" $0 }' \
  > | $DIALOG --list --title="Persistent Partition" --text="Select the partition that holds the loopback file." \
  > --multiple --column ' ' --column 'Partitions' --height=380 --width=150 \
  > --${BUTTON0}="OK"${BUTTON0NUM} --${BUTTON1}="Quit Task"${BUTTON1NUM}`

Adding --radiolist corrects it.

Code:
  `find /dev -mindepth 1 -maxdepth 1 -name "*[sh]d[a-z][1-9]" | grep $device | sort | awk '{print "\n" $0 }' | $DIALOG --list --title="Persistent Partition" --text="Select the partition that holds the loopback file." --multiple --column ' ' --column 'Partitions' --height=380 --width=150 --${BUTTON0}="OK"${BUTTON0NUM} --${BUTTON1}="Quit Task"${BUTTON1NUM} --radiolist
  /dev/sde1`

These were taken from refracta2usb and select-loop-mount. I don't know if the problems exist in snapshot or installer, but they might. Most of the testing I do is with yad.
Adding --radiolist changes the output with yad:

Code:
  `TRUE|/dev/sde1|`

fsmithred

- fsmithred
- Posts: 2101
- Joined: Wed Mar 09, 2011 9:13 pm

## Re: zenity problems

Sun Dec 15, 2013 2:52 pm

Adding

Code:
  `--separator ' '`

gets rid of the pipes.
Adding ${RADIOLIST} gets rid of the TRUE. RADIOLIST is --radiolist for zenity and is null for yad. The dashes need to be part of the variable in this case, unless you put ${RADIOLIST} as the last option, then it doesn't seem to matter. (talking about what happens if you have just -- with no argument when using yad.)
Is there another way?
Post a reply
Jump to:

Powered by phpBB © phpBB Group.

phpBB Mobile / SEO by Artodia.