in reply to Tk::BrowseEntry -- get() with nothing selected

"active" is not "selected". It is the item which has the location cursor, according to the Tk::Listbox manpage. A listbox which has the focus will have such an item underlined, at least on X11 systems.

You should rather use some of the *selection* methods.

  • Comment on Re: Tk::BrowseEntry -- get() with nothing selected

Replies are listed 'Best First'.
Re^2: Tk::BrowseEntry -- get() with nothing selected
by Grygonos (Chaplain) on Jun 07, 2004 at 14:30 UTC

    It's my understanding that the selection methods of Tk::Listbox modify the selection, and not return it. The curselection() method is not available by default in a Tk::BrowseEntry widget. Is there any way I can override the widget bindings so that the get method is defaulted to the Tk::Entry widget rather than the Tk::Listbox widget?

    Any help is appreciated,

    <edit>Well, I changed the BrowseEntry.pm to delegate to the entry widget rather than the scrolled listbox. However I would like to find a way to do it without trifling with the default bindings directly, (i.e. a code override rather than hard override)</edit>

      Use Subwidget, i.e. with $browseentry->Subwidget("subwidgetname")->method(...). The BrowseEntry documentation should provide the names of the advertides widgets.

        Yeah I saw that but had no clue how to use them. I figured it would be something like that...so it would be

        $be->Subwidget('entry')->get()

        Thanks for all your help on this,