gtk-sharp [00 24 00 00 04 80 00 00 94 00 00 00 06 02 00 00 00 24 00 00 52 53 41 31 00 04 00 00 01 00 01 00 71 EB 6C 55 75 52 9C BF 72 44 F7 A6 EA 05 62 84 F9 EA E0 3B CF F2 CC 13 2C 9C 49 0A B3 09 EA B0 B5 6B CE 44 9D F5 03 D9 C0 A8 1E 52 05 85 CD BE 70 E2 FB 90 43 4B AC 04 FA 62 22 A8 00 98 B7 A1 A7 B3 AF 99 1A 41 23 24 BB 43 25 F6 B8 65 BB 64 EB F6 D1 C2 06 D5 73 2D DF BC 70 A7 38 9E E5 3E 0C 24 6E 32 79 74 1A D0 05 03 E4 98 42 E1 9B F3 7B 19 8B 40 21 26 CB 36 89 C2 EA 64 96 A4 7C B4] 2.10.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. A widget used to choose from a list of items. using System; using Gtk; class ComboBoxSample { static void Main () { new ComboBoxSample (); } ComboBoxSample () { Application.Init (); Window win = new Window ("ComboBoxSample"); win.DeleteEvent += new DeleteEventHandler (OnWinDelete); ComboBox combo = ComboBox.NewText (); for (int i = 0; i < 5; i ++) combo.AppendText ("item " + i); combo.Changed += new EventHandler (OnComboBoxChanged); win.Add (combo); win.ShowAll (); Application.Run (); } void OnComboBoxChanged (object o, EventArgs args) { ComboBox combo = o as ComboBox; if (o == null) return; TreeIter iter; if (combo.GetActiveIter (out iter)) Console.WriteLine ((string) combo.Model.GetValue (iter, 0)); } void OnWinDelete (object obj, DeleteEventArgs args) { Application.Quit (); } } Gtk.Bin Gtk.CellEditable Gtk.CellLayout Method Gtk.ComboBox Convenience function which constructs a new text combo box, which is a just displaying strings. a If you use this function to create a text combo box, you should only manipulate its data source with the following convenience functions: , , and . Method System.Void Default handler for the event. Override this method in a subclass to provide a default handler for the event. Method System.Void Inserts at in the list of strings stored in . An index to insert . a to insert You can only use this function with combo boxes constructed with . Method System.Void Prepends to the list of strings stored in the . a You can only use this function with combo boxes constructed with . Method System.Void Pops up the menu or dropdown list of . This function is mostly intended for use by accessibility technologies; applications should have little use for it. Method System.Void Removes text at in the list of strings stored in . a You can only use this function with combo boxes constructed with . Method System.Boolean Gets the iter that points to the current active item, if it exists. a a , if it exists. Method System.Void Sets the current active item to be the one referenced by iter. a Method System.Void Hides the menu or dropdown list of this . This function is mostly intended for use by accessibility technologies; applications should have little use for it. Method System.Void Appends to the list of strings stored in . a You can only use this function with combo boxes constructed with . Method System.Void Re-inserts at . a a Note that has already to be packed into the combo box for this to function properly. i Method System.Void Adds the to the end of the combo box. a a If is , then the is allocated no more space than it needs. Any unused space is divided evenly between cells for which is . Method System.Void Packs the into the beginning of the combo box. a a If is , then the is allocated no more space than it needs. Any unused space is divided evenly between cells for which is . Method System.Void Adds an attribute mapping to the list in this combo box. a a , parameter on to be set from the value a , column of the model to get a value from. The is the column of the model to get a value from, and the is the parameter on to be set from the value. So for example if column 2 of the model contains strings, you could have the "text" attribute of a get its values from column 2. Method System.Void Clears all existing attributes previously set with . a Method System.Void Unsets all the mappings on all renderers for this combo box. Method System.Void Sets a data function to use for the combo box. a a The data function is used instead of the standard attributes mapping for setting the column value, and should set the value of the cell renderer as appropriate. may be to remove an older one. Constructor Internal constructor a System.Obsolete(Message=null, IsError=False) Constructor Internal constructor a Constructor Default constructor Gtk.ComboBox cb = new ComboBox(); cb.Clear(); CellRendererText cell = new CellRendererText(); cb.PackStart(cell, false); cb.AddAttribute(cell, "text", 0); ListStore store = new ListStore(typeof (string)); cb.Model = store; store.AppendValues ("Hello"); store.AppendValues ("Gtk"); store.AppendValues ("ComboBox"); Constructor Creates a new that uses a Property GLib.GType GType Property a Returns the native GLib.GType value for Combo. Property System.Int32 Wrap width for laying out the items in a grid. a Allowed values: >= 0 Default value: 0 GLib.Property(Name="wrap-width") Property System.Int32 The column with column span information. a The column span column contains integers which indicate how many columns an item should span. GLib.Property(Name="column-span-column") Property System.Int32 The index of the currently active item. a -1 if there is no active item. GLib.Property(Name="active") Property System.Int32 The column with row span information a The row span column contains integers which indicate how many rows an item should span. GLib.Property(Name="row-span-column") Property Gtk.TreeModel The which is acting as data source for the . a Will unset a previously set model (if applicable). If model is , then it will unset the model. setting the model does not clear the cell renderers, you have to call yourself if you need to set up different cell renderers for the new model. GLib.Property(Name="model") Event System.EventHandler Emitted when the selected item is changed. GLib.Signal(CName="changed") Method System.Void System.ParamArray Sets the attribute to column bindings for a renderer. a a The array should consist of pairs of attribute name and column indexes. Property System.Boolean To be added a To be added GLib.Property(Name="has-frame") Property System.Boolean To be added a To be added GLib.Property(Name="add-tearoffs") Property System.Boolean To be added a To be added GLib.Property(Name="focus-on-click") Property Atk.Object To be added a To be added Property System.String The currently active string in . a if no active item is selected. You can only use this function with combo boxes constructed with . Event System.EventHandler To be added To be added GLib.Signal(CName="editing_done") Event System.EventHandler To be added To be added GLib.Signal(CName="remove_widget") Property Gtk.TreeViewRowSeparatorFunc Callback function to indicate whether or not a given row of the combo box should be rendered as a separator. a Method System.Void To be added To be added Method System.Void To be added To be added Method System.Void To be added a To be added Method System.Void Default handler for the event. Override this method in a subclass to provide a default handler for the event. Method System.Void Default handler for the event. Override this method in a subclass to provide a default handler for the event. Constructor A list of string values for the combo entries. Creates a Combo box from a list of values. Property GLib.Property(Name="tearoff-title") System.String A title to display when the popup is torn off. defaults to . Property GLib.Property(Name="popup-shown") System.Boolean Indicates if the popup is currently visible. if the popup is visible.