gtk-sharp 2.6.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. An Entry is a single-line text entry widget. This widget should be used to retrieve small amounts of text from the user. A fairly large set of key bindings are supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible. See also the widget for displaying and editing large amounts of text. using System; using Gtk; class EntrySample { Entry entry; static void Main () { new EntrySample (); } EntrySample () { Application.Init (); Window win = new Window ("EntrySample"); win.SetDefaultSize (200, 150); win.DeleteEvent += new DeleteEventHandler (OnWinDelete); VBox vbox = new VBox (false, 1); win.Add (vbox); entry = new Entry ("hello world"); entry.Editable = true; entry.Visibility = true; vbox.Add (entry); CheckButton editable = new CheckButton ("Editable"); editable.Toggled += new EventHandler (OnEditableToggled); editable.Active = true; vbox.Add (editable); CheckButton visibility = new CheckButton ("Visibility"); visibility.Toggled += new EventHandler (OnVisibilityToggled); visibility.Active = true; vbox.Add (visibility); win.ShowAll (); Application.Run (); } void OnEditableToggled (object obj, EventArgs args) { entry.Editable = !entry.Editable; } void OnVisibilityToggled (object obj, EventArgs args) { entry.Visibility = !entry.Visibility; } void OnWinDelete (object obj, DeleteEventArgs args) { Application.Quit (); } } Gtk.Widget Gtk.CellEditable Gtk.Editable Method System.Int32 Add arbitrary text to the entry. the text to add The number of characters added. Use this method to insert a string at the current CursorPosition. Method System.Void Specific implementation of Gtk.CellEditable.StartEditing for the Entry widget. Method System.Void Specific implementation of Gtk.CellEditable.FinishEditing for the Entry widget. Method System.Void Specific implementation of Gtk.CellEditable.RemoveWidget for the Entry widget. Method System.Void Specific implementation of Gtk.Editable.SelectRegion for the Entry widget. Method System.String Specific implementation of Gtk.Editable.GetChars for the Entry widget. The index of the first character to get, (zero-indexed). The index of the character to retrieve up to. A string representing the characters from , up to, but not including . If is negative, then the the characters retrieved will be those characters from to the end of the text. Method System.Void Specific implementation of Gtk.Editable.DeleteText for the Entry widget. Method System.Void Specific implementation of Gtk.Editable.CopyClipboard for the Entry widget. Method System.Void Specific implementation of Gtk.Editable.DeleteSelection for the Entry widget. Deletes the currently selected text from the Entry. Method System.Boolean Get the the positions of the start and end of the current selection, if there is one. output variable for the character index of the selection start output variable for the character index of the end of the selection if there is a selection, otherwise. Method System.Void Copies any selected text to the clipboard and deletes it from the entry. Method System.Void Causes the contents of the clipboard to be pasted into the Entry at the current cursor position. Constructor Internal constructor Pointer to the C object. This is an internal constructor, and should not be used by user code. Constructor Construct a new entry widget Property System.Boolean Implements the concrete version of Gtk.Editable.IsEditable, to determine if the text of the Entry can be edited. true if the Entry is editable, false otherwise. Property System.Int32 The position of the cursor. the current cursor position The cursor is displayed before the character with the given (base 0) index in the widget. The value must be less than or equal to the number of characters in the widget. A value of -1 indicates that the position should be set after the last character in the entry. Note that this position is in characters, not in bytes. Property Pango.Layout Get the object used by this Entry for text layout. The Pango.Layout used to render the text of this entry. This property is read only. Property System.Boolean Determine whether to display characters entered, or whether to mask them. true if characters are being displayed, false if they are being masked. This property should be used to create entry widgets for sensitive data such as passwords. GLib.Property(Name="visibility") Property System.Int32 The maximum number of characters that can be placed in this Entry. The maximum number of characters that can currently be set in this Entry. This property can be useful for ensuring no more than a specific number of characters are put in an entry. GLib.Property(Name="max_length") Property System.Int32 The position of the cursor in the text of the Entry. The current character of the cursor. Use this property to manipulate the position of the cursor - it is displayed before the character with the given (base 0) index in the widget. The value must be less than or equal to the number of characters in the widget. A value of -1 indicates that the position should be set after the last character in the entry. Note that this position is in characters, not in bytes. GLib.Property(Name="cursor_position") Property System.Int32 The length of the selected text. The number of selected characters. GLib.Property(Name="selection_bound") Property System.String Manipulate the current text contents of an Entry. The current text in an Entry. GLib.Property(Name="text") Property System.Int32 Number of pixels the entry scrolled off the screen to the left. A GLib.Property(Name="scroll_offset") Property System.Int32 Changes the size request of the entry to be about the right size for characters. The number of characters requested. Note that it changes the size request, the size can still be affected by how you pack the widget into containers. If n_chars is -1, the size reverts to the default entry size. GLib.Property(Name="width_chars") Property System.Boolean Whether or not this Entry is editable. if this entry can be edited, otherwise. Set this property to false if you need to stop input into an Entry widget. For displaying textual data, it is more normal to use a instead. System.Obsolete(Message="Replaced by IsEditable property", IsError=False) Property System.Boolean Determine whether to activate the 'default widget' in the window when the return key is pressed. if the default button will be activated, false otherwise. If the value is , pressing Enter in the entry will activate the default widget for the window containing the entry. This usually means that the dialog box containing the entry will be closed, since the default widget is usually one of the dialog buttons. (For experts: if the value is , the entry calls on the containing the entry, in the default handler for the event). GLib.Property(Name="activates_default") Property System.Boolean Whether or not this Entry should be surrounded by a 3D frame. if a frame surrounds this Entry, otherwise Unless there is a very specific reason for doing so, this property is best left to its default to ensure consistency in Entry widgets across applications. GLib.Property(Name="has_frame") Event System.EventHandler Implements the WidgetRemoved method of the interface. This will effectively destroy the Entry. GLib.Signal(CName="remove_widget") Event System.EventHandler Implements the EditingDone method of the interface. GLib.Signal(CName="editing_done") Event Gtk.TextInsertedHandler Connect to this event to be notified when text is inserted into the Entry. GLib.Signal(CName="insert_text") Event Gtk.TextDeletedHandler Connect to this event to be notified when text is deleted from the Entry. GLib.Signal(CName="delete_text") Event System.EventHandler When the contents of the Entry change, this event is raised. GLib.Signal(CName="changed") Event Gtk.MoveCursorHandler Connect to this event handler to be notified when the cursor of an Entry moves. Data pertaining to this event is passed with a . GLib.Signal(CName="move_cursor") Event System.EventHandler Connect to this event to be notified when the user 'cuts' a selection in the Entry. Connect to this event with a standard . GLib.Signal(CName="cut_clipboard") Event System.EventHandler Connect to this event to be notified when the user hits 'return'. Connect to this event with a standard . GLib.Signal(CName="activate") Event Gtk.DeleteFromCursorHandler Connect to this event to find out when text is deleted from the Entry by the user. Data pertaining to this event is encapsulated in a . GLib.Signal(CName="delete_from_cursor") Event System.EventHandler Connect to this event to be notified when the clipboard contents are pasted into this Entry. Connect to this event with a standard . GLib.Signal(CName="paste_clipboard") Event System.EventHandler Connect to this event to be notified when the contents of the Entry are copied to the clipboard. Connect to this event with a standard . GLib.Signal(CName="copy_clipboard") Event Gtk.PopulatePopupHandler Raised when the popup handler needs to be filled with data. Data pertaining to this event is encapsulated in a . GLib.Signal(CName="populate_popup") Event System.EventHandler Connect to this event to discover when the Overwrite state has been changed by the user. This is usually done by pressing the 'Insert' key on a keyboard. Connect to this event with a standard . GLib.Signal(CName="toggle_overwrite") Event Gtk.InsertAtCursorHandler Connect to this event to discover when text is inserted at the cursor position - usually when the user types something in. Data pertaining to this event is encapsulated in an . GLib.Signal(CName="insert_at_cursor") Method System.Void Add text to the entry just before . A A Constructor Public constructor. A Method System.Void Obtains the position of the PangoLayout used to render text in the entry, in widget coordinates. X offset output of the layout. Y offset output of the layout. Useful if you want to line up the text in an entry with some other text, e.g. when using the entry to implement editable cells in a sheet widget. - Also useful to convert mouse events into coordinates inside the PangoLayout, e.g. to take some action if some part of the entry text is clicked. Property GLib.GType GType Property. a Returns the native value for . Method System.Void Default handler for the event. a 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. Method System.Void Default handler for the event. a 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. 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. a a 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. 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. a a a 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. Method System.Void Default handler for the event. a a Override this method in a subclass to provide a default handler for the event. Method System.Void Default handler for the event. a a 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. Method System.Void Default handler for the event. Override this method in a subclass to provide a default handler for the event. Constructor Protected Constructor. a Chain to this constructor if you have manually registered a native value for your subclass. System.Obsolete(Message=null, IsError=False) Property System.Single The horizontal alignment, from 0 (left) to 1 (right). a Reversed for RTL layouts. Allowed values: [0,1] Default value: 0 GLib.Property(Name="xalign") Property System.Single The alignment for the contents of the entry a This controls the horizontal positioning of the contents when the displayed text is shorter than the width of the entry. The horizontal alignment, from 0 (left) to 1 (right). Reversed for RTL layouts Property Gtk.EntryCompletion The auxiliary completion object a All further configuration of the completion mechanism is done on completion using the API. Method System.Void Prepends the given text to the contents of the widget. a Method System.Void Appends the given text to the contents of the widget. a Constructor Creates a new with the given maximum length. a , the maximum length of the entry, or 0 for no maximum. the existence of this function is inconsistent with the rest of the Gtk API. The normal setup would be to just require the user to make an extra call to instead. It is not expected that this function will be removed, but it would be better practice not to use it. Property System.Char The character to display when is a The is the character displayed in the entry in place of the actual characters of when is . The default invisible character is an asterisk ('*'). If you set this to 0, then no characters will be displayed at all. GLib.Property(Name="invisible_char") Event System.EventHandler To be added To be added GLib.Signal(CName="backspace") Method System.Void Default handler for the event. Override this method in a subclass to provide a default handler for the event. Method System.Int32 To be added a a To be added Method System.Int32 To be added a a To be added