Re: Adding a St.Entry to a PopupMenu

I bumped into something like this. I ended up disabling events to handle it: Like this:


here _promptMenuItem is a menu item with an St.Entry in it.

Hope this helps. I'll be following this to see what people who are more knowledgeable than me recommend.


On Sat, Dec 17, 2011 at 12:24 PM, Alessandro Crismani <alessandro crismani gmail com> wrote:
Hi all,

I am trying to write an extension that adds a Popup menu to the top
panel. I would like to add an St.Entry to the Popup menu to input a
search term. I've tried with:

       this._searchEntry = new PopupMenu.PopupMenuItem("");
       this._search = new St.Entry({ name: 'searchEntry',
                                    hint_text: _("Type to search..."),
                                    track_hover: true,
                                    can_focus: true });
       this._text = this._search.clutter_text;
       this._text.connect('text-changed', Lang.bind(this,
       this._searchEntry.addActor(this._search, { align:
St.Align.End });;

This adds the search entry to the Popup Menu, but when I click on it the
menu closes (as if I clicked a standard menu item) instead of giving
focus to the entry.

What is the right way to add a St.Entry as a menu item?


gnome-shell-list mailing list
gnome-shell-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]