protected override bool OnButtonPressEvent(Gdk.EventButton ev) { IDesignArea d = WidgetUtils.GetDesignArea(this); if (d.IsSelected(this)) { if (Child is Gtk.Label) { StartEditing(); return(true); } } else { d.SetSelection(this, null); return(true); } return(false); }
public void StartEditing() { if (Child is Gtk.Label) { IDesignArea d = WidgetUtils.GetDesignArea(this); IObjectSelection sel = d.GetSelection(this); if (sel == null) { sel = d.SetSelection(this, null); } sel.Disposed += SelectionDisposed; Remove(Child); Add(CreateEntry()); ShowAll(); Child.GrabFocus(); } }