summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rwxr-xr-xsrc/gdialog.in31
2 files changed, 30 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 27776909..ceeeb169 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
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>
+
* help/C/zenity.xml: Documentation updates from Nicholas Curran.
* THANKS, src/about.c: Add Nicholas.
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;
}
bgstack15