Is it possible to have a Zenity list-style menu show a code option like
I am trying to make a simple GUI for an FFMPEG bash script. This is just one prompt for selecting a framerate for a video. I wanted one of the Zenity list columns to show the actual FFMPEG option that would be used, it would be for returning to be used in the FFMPEG code, but also to hopefully teach some FFMPEG syntax to the user. Like this:
#!/bin/sh zenity --list \ --title="Select framerate" \ --column="ffmpeg code" --column="Framerate" --column="Description" \ "-r 24000/1001" "23.976fps" "NTSC compatible 24fps" \ "-r 30000/1001" "29.98fps" "NTSC compatible 30fps"
But this gives the Zenity error message:
This option is not available. Please see --help for all possible usages.
I think I understand what the problem is; Zenity thinks the
-r is a Zenity option, and doesn't recognize it.
Just removing the
- before the
-r fixes it:
zenity --list \ --title="Select framerate" \ --column="ffmpeg code" --column="Framerate" --column="Description" \ "r 24000/1001" "23.976fps" "NTSC compatible 24fps" \ "r 30000/1001" "29.98fps" "NTSC compatible 30fps"
Shows no error and correctly displays:
But then of course this would not teach anyone how to use the FFMPEG framerate option because the dash is needed.
Escaping the dash with a backslash like
\- just prints the backslash too, which would also not teach anyone FFMPEG:
I've also tried using
''' instead of the double quotes, but they give the same
This option is not available... error message.
Is it just not possible to get Zenity to display something like that? I know there are ways around the problem if I just want the list to return the code ( just appending
-r on beginning of the output) but as I said I'd like to be able to teach the user of the GUI a little about using the FFMPEG command line interface. Any ideas? Thank you.
Edit: By the way
zenity --version on my system (Xubuntu 14.04) returns
3.8.0 if the version could be part of the problem.