3

I am trying to create a pop up window with zenity to get some inputs from the user.

parameters=$(zenity --forms --title="Add Parameters"  --separator="," --add-entry="Dimensionality" --add-entry="float" --add-entry="Interpolation" --add-entry="winsorize image intensities" --add-entry="Use histogram matching" --add-entry="Num_transform" --add-entry="Convergence" --add-entry="Metric" --add-entry="Shrink Factors" --add-entry="Smoothing sigmas")

Result

So now i want these fields to have default values in order to be easier for the user. I tried the --entry-text but i'm getting the error --entry-text is not supported for this dialogue.

Any ideas?

Christos ZS
  • 109
  • 2
  • 11

2 Answers2

3

I believe that setting the default values for multiple values displayed on the same zenity window is not possible, the program does not support that.

If you don't have to use zenity, then the program yad can do what you need.

hoijui
  • 3,615
  • 2
  • 33
  • 41
Jamil Said
  • 2,033
  • 3
  • 15
  • 18
  • Indeed, unless there is a particular reason for you to use zenity, switch to yad which is a fork of zenity with much more enhancments. Zenity commands (syntax etc) work the same in yad. – George Vasiliou Nov 21 '16 at 09:52
  • I am trying to make a toolbox and i want to use as few extras as possible. I am already using two so i would like to avoid adding yad too. If there is no other way though i guess i will have to do it.. – Christos ZS Nov 21 '16 at 23:42
1

This is the command version of Jamils answer:

useroutput=$(yad --width=1000 --form --title="This is my question to user" --field="" "default textbox value" --separator="")
echo $useroutput

--title = titlebar text

--field = textbox. If you put something inside the quotes, it displays text to the left of textbox.

--separator = If unspecified the output sticks a pipe at the end. Blank means you want output without separator character.

--width = Width of Dialog. Will also increase the size of the textbox.

Jeff Luyet
  • 424
  • 3
  • 10