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]Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.Gtk.BinGtk.CellEditableGtk.CellLayoutA 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 ();
}
}
ConstructorDefault 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
To be added.
To be added.To be added.Constructor
a Creates a new that uses Constructor
To be added.
To be added.To be added.Constructor
a Internal constructorConstructor
A list of string values for the combo entries.
Creates a Combo box from a list of values.PropertyGLib.Property("active")System.Int32The index of the currently active item.a -1 if there is no active item.PropertyGLib.Property("active-id")System.StringTo be added.To be added.To be added.MethodSystem.Void
a
a , parameter on to be set from the value
a , column of the model to get a value from.
Adds an attribute mapping to the list in this combo box.
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.
PropertyGLib.Property("add-tearoffs")System.BooleanTo be addeda To be addedPropertyGtk.CellAreaTo be added.To be added.To be added.PropertyGLib.Property("button-sensitivity")Gtk.SensitivityTypeTo be added.To be added.To be added.PropertyGLib.Property("cell-area")Gtk.CellAreaTo be added.To be added.To be added.PropertyGtk.CellRenderer[]To be added.To be added.To be added.EventGLib.Signal("changed")System.EventHandlerEmitted when the selected item is changed.MethodSystem.VoidUnsets all the mappings on all renderers for this combo box.MethodSystem.Void
a
Clears all existing attributes previously set with
.
PropertyGLib.Property("column-span-column")System.Int32The column with column span information.a The column span column contains integers which indicate how many columns an item should span.EventGLib.Signal("editing-done")System.EventHandlerTo be addedTo be addedPropertyGtk.EntryTo be added.To be added.To be added.PropertyGLib.Property("entry-text-column")System.Int32To be added.To be added.To be added.MethodSystem.VoidTo be addedTo be addedPropertyGLib.Property("focus-on-click")System.BooleanSets or gets whether the combo box will grab focus when it is clicked with the mouse.a Making mouse clicks not grab focus is useful in places like toolbars where you don't want the keyboard focus removed from the main area of the application.MethodSystem.Boolean
a Gets the iter that points to the current active item, if it exists.a , if it exists.PropertyGLib.GTypeGType Propertya Returns the native GLib.GType value for Combo.PropertyGLib.Property("has-entry")System.BooleanTo be added.To be added.To be added.PropertyGLib.Property("has-frame")System.BooleanTo be addeda To be addedPropertyGLib.Property("id-column")System.Int32To be added.To be added.To be added.PropertyGLib.Property("model")Gtk.TreeModelThe 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.
EventGLib.Signal("move-active")Gtk.MoveActiveHandlerTo be added.To be added.MethodGtk.ComboBox
To be added.
To be added.To be added.To be added.MethodGtk.ComboBoxTo be added.To be added.To be added.MethodGtk.ComboBox
To be added.
To be added.To be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideChanged", Type=typeof(Gtk.ComboBox))System.VoidDefault handler for the event.Override this method in a subclass to provide a default handler for the event.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideEditingDone", Type=typeof(Gtk.ComboBox))System.VoidDefault handler for the event.Override this method in a subclass to provide a default handler for the event.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideMoveActive", Type=typeof(Gtk.ComboBox))System.Void
To be added.
To be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverridePoppedDown", Type=typeof(Gtk.ComboBox))System.BooleanTo be added.To be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverridePoppedUp", Type=typeof(Gtk.ComboBox))System.VoidTo be added.To be added.MethodGLib.DefaultSignalHandler(ConnectionMethod="OverrideWidgetRemoved", Type=typeof(Gtk.ComboBox))System.VoidDefault handler for the event.Override this method in a subclass to provide a default handler for the event.MethodSystem.Void
a
a Adds the to the end of the combo box.
If is , then the
is allocated no more space than it needs. Any unused space is
divided evenly between cells for which is .
MethodSystem.Void
a
a Packs the into the beginning of the combo box.
If is , then the
is allocated no more space than it needs. Any unused space is
divided evenly between cells for which is .
MethodSystem.VoidHides the menu or dropdown list of this .This function is mostly intended for use by accessibility technologies; applications should have little use for it.EventGLib.Signal("popdown")Gtk.PoppedDownHandlerTo be added.To be added.EventGLib.Signal("popup")System.EventHandlerTo be added.To be added.MethodSystem.VoidPops up the menu or dropdown list of .This function is mostly intended for use by accessibility technologies; applications should have little use for it.PropertyAtk.ObjectTo be addeda To be addedPropertyGLib.Property("popup-fixed-width")System.BooleanTo be added.To be added.To be added.MethodSystem.Void
To be added.
To be added.To be added.PropertyGLib.Property("popup-shown")System.BooleanIndicates if the popup is currently visible.if the popup is visible.MethodSystem.VoidTo be addedTo be addedMethodSystem.Void
a
a Re-inserts at .
Note that has already to be packed
into the combo box for this to function properly.
i
PropertyGtk.TreeViewRowSeparatorFuncCallback function to indicate whether or not a given row of the combo box should be rendered as a separator.a PropertyGLib.Property("row-span-column")System.Int32The column with row span informationa The row span column contains integers which indicate how many rows an item should span.MethodSystem.Void
a Sets the current active item to be the one referenced by iter.MethodSystem.VoidSystem.ParamArray
a
a Sets the attribute to column bindings for a renderer.The array should consist of pairs of attribute name and column indexes.MethodSystem.Void
a
a Sets a data function to use for the combo box.
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.
MethodSystem.Void
a To be addedTo be addedPropertyGLib.Property("tearoff-title")System.StringA title to display when the popup is torn off.defaults to .EventGLib.Signal("remove-widget")System.EventHandlerTo be addedTo be addedPropertyGLib.Property("wrap-width")System.Int32Wrap width for laying out the items in a grid.a
Allowed values: >= 0
Default value: 0