gtk-sharp0.0.0.0neutralGtk# 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.HBoxAtk.ImplementorGLib.IWrapperGLib.IWrapperSystem.IDisposableMethodSystem.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.MethodSystem.VoidDisposes the resources associated with the object.ConstructorInternal constructor
Pointer to the C object.
An instance of , wrapping the C object.This is an internal constructor, and should not be used by user code.ConstructorCreates a new .an object of type 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. ---- To get out ----
To be added: an object of type 'bool'
To be added: an object of type 'bool'To be addedPropertySystem.BooleanSpecifies if the arrow (cursor) keys can be used to step through the items in the list.
an object of type if the arrow keys can be used to step through the items in the list.This is on by default.PropertySystem.BooleanTo be added
To be added: an object of type 'bool'
To be added: an object of type 'bool'To be addedPropertySystem.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 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.PropertySystem.BooleanSpecifies if an empty field is acceptable. if an empty value is considered valid.
if an empty value is considered valid.To be addedPropertySystem.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.
if the arrow keys can be used to step through the items in the list.This is by default.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.
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.PropertyGLib.GTypeGType Property.a Returns the native value for .ConstructorProtected Constructor.
a a Chain to this constructor if you have manually registered a native value for your subclass.PropertySystem.String[]Property to set all of the items in the popup list.An array of strings.