After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 311038 - Dropmenu Options
Dropmenu Options
Status: RESOLVED FIXED
Product: zenity
Classification: Core
Component: general
2.10.x
Other Linux
: Normal enhancement
: ---
Assigned To: Zenity Maintainers
Zenity Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-07-20 17:27 UTC by Matthew Burke
Modified: 2006-05-11 01:31 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
Adds the requested feature. (6.09 KB, patch)
2006-03-30 21:24 UTC, Diego Escalante Urrelo (not reading bugmail)
needs-work Details | Review
Creates a ComboBoxEntry using --entry-text parameters or argv parameters (7.40 KB, patch)
2006-04-01 15:30 UTC, Diego Escalante Urrelo (not reading bugmail)
none Details | Review

Description Matthew Burke 2005-07-20 17:27:21 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.
Comment 1 Lucas Rocha 2005-07-20 18:22:06 UTC
Could you be more clear? Do you mean a dropdown menu column on list dialogs?
Comment 2 Matthew Burke 2005-07-20 20:23:47 UTC
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.
Comment 3 Matthew Burke 2005-07-20 20:51:48 UTC
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...'
Comment 4 Matthew Burke 2005-07-21 15:57:26 UTC
Sorry. Forgot to reopen  this after I added more info. :P
Comment 5 Diego Escalante Urrelo (not reading bugmail) 2006-03-30 21:24:00 UTC
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.
Comment 6 Diego Escalante Urrelo (not reading bugmail) 2006-03-30 21:24:44 UTC
Created attachment 62423 [details] [review]
Adds the requested feature.
Comment 7 Lucas Rocha 2006-03-31 22:59:42 UTC
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)
Comment 8 Diego Escalante Urrelo (not reading bugmail) 2006-04-01 15:28:46 UTC
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.

Comment 9 Diego Escalante Urrelo (not reading bugmail) 2006-04-01 15:30:44 UTC
Created attachment 62549 [details] [review]
Creates a ComboBoxEntry using --entry-text parameters or argv parameters
Comment 10 Lucas Rocha 2006-05-11 01:31:52 UTC
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>.