From 0664c941978b167c44441758de7ee383fca6251b Mon Sep 17 00:00:00 2001
From: Mike Newman <MikeGTN@src.gnome.org>
Date: Tue, 20 May 2003 23:48:12 +0000
Subject: Update to gdialog wrapper script

---
 src/gdialog | 42 ++++++++++++++++++++++++++++++++++++++----
 1 file changed, 38 insertions(+), 4 deletions(-)

(limited to 'src/gdialog')

diff --git a/src/gdialog b/src/gdialog
index 2eb5b0f..14e7bed 100644
--- a/src/gdialog
+++ b/src/gdialog
@@ -112,25 +112,59 @@ ARG: while ($argn < $args) {
 		# Conveniently, zenity and gdialog use the same names
 		# for list types, so pass this to zenity intact along with
 		# an untitled column for the check or radio buttons
+		# and the 'text' arg as a second column header
 		
 		$command .= "--list $list --column='' --column $element ";
 			
-		# Skip to the first 'name' arg of the list content
+		# Skip to the first 'item' arg of the list content
+		# bypassing height, width and list-height
+		# from here args run [tag] [item] [status] ...
 
-		$argn += 6; 
+		$argn += 5; 
 		
 		# Loop over the remainder of the commandline
 		# discarding the 'status' and 'tag' args of each item 
-		# and using the 'name' for display in our second column
+		# and using the 'item' for display in our second column
+		# also pass a NULL argument since zenity can't set the status
+		# of a row like gdialog can
 		
 		while ($argn < $args) {
 			get_arg;
-			$command .= "$element ";
+			$command .= "NULL $element ";
 			$argn += 3;
 		}
 		last ARG;
 	} 
 	
+	if ($element eq "--menu") {
+		$list=$element;
+		$argn++;
+		get_arg;
+		
+		# a gdialog --menu is just a one column zenity --list
+		# Use the 'text' arg as a second column header
+		# FIXME: or should it be the dialog text?
+		
+		$command .= "--list --column $element ";
+			
+		# Skip to the first 'item' arg of the list content
+		# bypassing height, width and list-height
+		# from here args run [tag] [item] ...
+
+		$argn += 5; 
+		
+		# Loop over the remainder of the commandline
+		# discarding the 'tag' args of each item 
+		# and using the 'item' for display in our second column
+		
+		while ($argn < $args) {
+			get_arg;
+			$command .= "$element ";
+			$argn += 2;
+		}
+		last ARG;
+	} 
+	
 	if ($element eq "--gauge") {
 		$argn++;
 		get_arg;
-- 
cgit v1.2.3-2-g168b