Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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();
            }
        }