Re: Combo widget with no user input?

Jan Jirmasek wrote:
  >On Wed, 6 Sep 2000, Nils Rennebarth wrote:
  >> Is there a widget that looks like the combo box but only allows the user t
  >> select from the list, not to type in her own entry?
  >This should be enough:
  >  gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(combo_box)->entry),FALSE);

This function from GtkCombo seems to match what you want:

void        gtk_combo_set_value_in_list     (GtkCombo *combo,
                                             gint val,
                                             gint ok_if_empty);

Specifies whether the value entered in the text entry field must match
one of the values in the list. If this is set then the user will not be
able to perform any other action until a valid value has been entered.
If an empty field is acceptable, the ok_if_empty parameter should be TRUE.

	combo       : a GtkCombo.
	val         : TRUE if the value entered must match one of the
                      values in the list.
	ok_if_empty : TRUE if an empty value is considered valid.
(from GTK+ reference documentation).

Oliver Elphick                                Oliver Elphick lfix co uk
Isle of Wight                    
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
     "Behold, I stand at the door, and knock; if any man 
      hear my voice, and open the door, I will come in to 
      him, and will sup with him, and he with me."       
                                   Revelation 3:20 

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]