gtk-sharp2.6.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.A text entry field with a dropdown list
The widget consists of a single-line text entry field and a
drop-down list. The drop-down list is displayed when the user clicks
on a small arrow button to the right of the entry field.
The drop-down list is a widget and can be accessed using the
list member of the . List elements can contain arbitrary
widgets, but if an element is not a plain label, then you must use
the function. This sets the string which
will be placed in the text entry field when the item is selected.
By default, the user can step through the items in the list using the
arrow (cursor) keys, though this behaviour can be turned off with
= .
Creating a widget with simple text items:
using System;
using Gtk;
class ComboSample
{
Combo combo;
static void Main ()
{
new ComboSample ();
}
ComboSample ()
{
Application.Init ();
Window win = new Window ("ComboSample");
win.DeleteEvent += new DeleteEventHandler (OnWinDelete);
string[] list = new string[] {"one", "two", "three"};
combo = new Combo ();
combo.PopdownStrings = list;
combo.DisableActivate ();
combo.Entry.Activated += new EventHandler (OnEntryActivated);
win.Add (combo);
win.ShowAll ();
Application.Run ();
}
void OnEntryActivated (object o, EventArgs args)
{
Console.WriteLine (combo.Entry.Text);
}
void OnWinDelete (object obj, DeleteEventArgs args)
{
Application.Quit ();
}
}
Gtk.HBoxSystem.Obsolete(Message=null, IsError=False)MethodSystem.VoidSets the string to place in the field when a particular list item is selected.
an object of type
an object of type This is not needed if the list item is a simple .MethodSystem.VoidDisables showing the popup list on the activate event.Stops the widget from showing the popup list when the emits the event, i.e. when the Return key is pressed.
This may be useful if, for example, you want the Return key to close a dialog instead.ConstructorInternal constructor
Pointer to the C object.
This is an internal constructor, and should not be used by user code.ConstructorCreates a new .This is the default contructor for PropertyGtk.ButtonThe asociated with the .an object of type PropertyGtk.EntryThe asociated with the .an object of type PropertySystem.BooleanDoes nothing. ---- REMOVE ---- See EnableArrowKeys.a PropertySystem.BooleanSpecifies if the arrow (cursor) keys can be used to step through the items in the list. See also EnableArrowKeys. if the arrow keys can be used to step through the items in the list.This is on by default.PropertySystem.BooleanSee a GLib.Property(Name="enable_arrows_always")PropertySystem.BooleanSpecifies whether the value entered in the text entry field must match one of the values in the list. if the value entered 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.GLib.Property(Name="value_in_list")PropertySystem.BooleanSpecifies if an empty field is acceptable. if an empty value is considered valid.GLib.Property(Name="allow_empty")PropertySystem.BooleanSpecifies if the arrow (cursor) keys can be used to step through the items in the list. if the arrow keys can be used to step through the items in the list.This is by default.GLib.Property(Name="enable_arrow_keys")PropertySystem.BooleanSpecifies whether the text entered into the field and the text in the list items is case sensitive. if the text in the list items is case sensitive.This may be useful, for example, when you have set true ValueInList to limit the values entered, but you are not worried about differences in case.GLib.Property(Name="case_sensitive")PropertyGLib.GTypeGType Property.a Returns the native value for .ConstructorProtected constructor.
a Chain to this constructor if you have manually registered a native value for your subclass.System.Obsolete(Message=null, IsError=False)PropertySystem.String[]Property to set all of the items in the popup list.An array of strings.MethodSystem.VoidWhether entered values must already be present in the list.
a
a PropertyGtk.WidgetTo be added.To be added.To be added.