void EditShown(object obj, EventArgs args)
{
Gtk.Editable focus = Focus;
if (focus != null) {
int selStart, selEnd;
bool hasSelection, editable;
hasSelection = focus.GetSelectionBounds (out selStart, out selEnd);
editable = focus.IsEditable;
UpdateEdit (hasSelection && editable, hasSelection, editable);
} else
UpdateEdit ();
}