diff options
author | Glynn Foster <glynn.foster@sun.com> | 2003-09-01 18:44:19 +0000 |
---|---|---|
committer | Glynn Foster <gman@src.gnome.org> | 2003-09-01 18:44:19 +0000 |
commit | 82b76239aa0d85d24778e68c5bf0fb51e9d25b0a (patch) | |
tree | 434c300875c1d5dfc7d2706898bb1c602be490d9 /src | |
parent | Documentation updates from Nicholas Curran. Add Nicholas. (diff) | |
download | zenity-82b76239aa0d85d24778e68c5bf0fb51e9d25b0a.tar.gz zenity-82b76239aa0d85d24778e68c5bf0fb51e9d25b0a.tar.bz2 zenity-82b76239aa0d85d24778e68c5bf0fb51e9d25b0a.zip |
Add patch from Buchan Miln to fix the gdialog wrapper.
2003-09-01 Glynn Foster <glynn.foster@sun.com>
* src/gdialog.in: Add patch from Buchan Miln to fix the gdialog
wrapper.
Diffstat (limited to 'src')
-rwxr-xr-x | src/gdialog.in | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/src/gdialog.in b/src/gdialog.in index 004571ba..ff47010d 100755 --- a/src/gdialog.in +++ b/src/gdialog.in @@ -259,26 +259,45 @@ ARG: while ($argn < $args) { $argn++; get_arg; - # a gdialog --menu is just a one column zenity --list + # a gdialog --menu is just a two column zenity --list + # Leave the first column blank (not provided) # Use the 'text' arg as a second column header # FIXME: or should it be the dialog text, or both? - $command .= "--list --column $element "; + $command .= "--list --column '' --column \"$element\" "; # Skip to the first 'item' arg of the list content - # bypassing height, width and list-height + # after using height, width and bypassing list-height # from here args run [tag] [item] ... - $argn += 5; + $argn += 1; + + get_arg; + # Height and width in characters to be displayed, so adjust + # cdialog uses 6 height for non-list, zenity uses ~24 pixels + # per list entry (default font), and 103 pixels for non-list + # This appears to be almost exact + $element = $element*24 - 35; + $command .= " --height $element"; + + $argn += 1; + get_arg; + # cdialog uses 6 width for non-list, zenity uses ~7 pixels + # per character (default font), and 22 pixels for non-list + # This is not exact, but close enough + $element = $element*7 - 20; + $command .= " --width $element " ; + + $argn += 2; # Loop over the remainder of the commandline - # discarding the 'tag' args of each item + # keeping 'tag' args of each item (required to return) # and using the 'item' for display in our second column while ($argn < $args) { get_arg; $command .= "$element "; - $argn += 2; + $argn += 1; } last ARG; } |