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.
This commit is contained in:
Glynn Foster 2003-09-01 18:44:19 +00:00 committed by Glynn Foster
parent 751d9a7bec
commit 82b76239aa
2 changed files with 30 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2003-09-01 Glynn Foster <glynn.foster@sun.com>
* src/gdialog.in: Add patch from Buchan Miln to fix the gdialog
wrapper.
2003-09-01 Glynn Foster <glynn.foster@sun.com> 2003-09-01 Glynn Foster <glynn.foster@sun.com>
* help/C/zenity.xml: Documentation updates from Nicholas Curran. * help/C/zenity.xml: Documentation updates from Nicholas Curran.

View File

@ -259,26 +259,45 @@ ARG: while ($argn < $args) {
$argn++; $argn++;
get_arg; 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 # Use the 'text' arg as a second column header
# FIXME: or should it be the dialog text, or both? # 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 # 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] ... # 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 # 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 # and using the 'item' for display in our second column
while ($argn < $args) { while ($argn < $args) {
get_arg; get_arg;
$command .= "$element "; $command .= "$element ";
$argn += 2; $argn += 1;
} }
last ARG; last ARG;
} }