GNOME Bugzilla – Bug 311038
Dropmenu Options
Last modified: 2006-05-11 01:31:52 UTC
Version details: 2.10.0 Distribution/Version: Ubuntu 5.04 An option for a dropdown menu would be nice to use with the --list dialog.
Could you be more clear? Do you mean a dropdown menu column on list dialogs?
Sorry about that. No. What I mean would be more like a dropdown menu on entry dialogs. Instead of an entry dialog where the user types the entry, they would have a dropdown menu of predefined answers. It would basically serve the same purpose of '--list --column="My List" answer1 answer2 answer3 etc...' but it would have a different look and feel.
It could really be added to either the entry dialog or the list dialog. If it were to be in the entry dialog ... instead of: 'zenity --entry --entry-text="typestuffhere"' you could do: 'zenity --entry --entry-menu "option 1" "option 2" "option 3" etc...'
Sorry. Forgot to reopen this after I added more info. :P
Attaching a patch to implement this. It creates a GtkComboBoxEntry when you call something like: $ zenity --entry --entry-text yeeeer --entry-text yaaar If you only use one --entry-text option it creates a GtkEntry.
Created attachment 62423 [details] [review] Adds the requested feature.
Hey Diego, the aproach you adopted is not good (--text for each row). See what is suggested in comment #3: it's more intuitive and cleaner. Here's an example: zenity --entry --entry-text="My default value here" (GtkEntry) zenity --entry --entry-text="My default value here" "Value 1" "Value 2" "Value 3" (GtkComboBoxEntry)
Ok, I checked that out and now the behavior is like this: [gives you a CombBoxEntry with aa and dd as options] $ zenity --entry --entry-text aa --text 31312312 dd [gives you a Entry with d as text] $ zenity --entry --entry-text dd [gives you a CombBoxEntry with aa, bb, cc and dd as options] $ zenity --entry --entry-text aa bb cc dd Basically any remaining value in argv is parsed as something that should go into the Entry/ComboBoxEntry.
Created attachment 62549 [details] [review] Creates a ComboBoxEntry using --entry-text parameters or argv parameters
Ok, commited in HEAD with several changes. Thanks! 2006-05-10 Lucas Rocha <lucasr@gnome.org> * src/entry.c (zenity_entry_fill_entries, zenity_entry), src/main.c, src/option.c, src/zenity.glade, src/zenity.h: add dropdown menu to entry dialog (Fixed bug #311038). Patch from Diego Escalante Urrelo <dieguito@gmail.com>.