einhverfr has asked for the wisdom of the Perl Monks concerning the following question:

Fellow monks

Still working on the wxperl point of sale application and trying to add autocomplete to some text fields.

The wxwidget documentation mentions a wxTextCompleter and a wxTextCompleterSimple class. I have tried to instantiate these and I keep getting errors that the class is empty. Am I missing something? Is there a workable alternative for wxWidget-based applications?

The lines in my code are:

package Package::Name; # not the real name but... use Wx; use base 'Wx::wxTextCompleterSimple'; # these lines copied verbatim
My error is: Base class package "Wx::wxTextCompleterSimple" is empty.

Replies are listed 'Best First'.
Re: No wxTextCompleterSimple class? ( nope )
by Anonymous Monk on Nov 15, 2013 at 10:11 UTC

      Thanks, the lines were copied from my source code.

      What I was trying to find is where I was going wrong. It looks like my system has wxwidgets 2.8 which is the main source of the problem. Apparently it is a good idea to follow the same version of docs and code...

      I ended up switching for now from textboxes to comboboxes to try to implement my own autocomplete that way. However if I setfocus to the combobox, it selects the text which makes it very hard to change the combinations in it. Do you know of a good way to do autocomplete with wxPerl and wxwidgets 2.8?

      Edit: Never mind. I found that the issue was that the best thing to do was to avoid setting the value, and instead process the items on the list.

Re: No wxTextCompleterSimple class?
by stefbv (Priest) on Nov 15, 2013 at 09:59 UTC

    What wxWidgets version do you use?

    Conform to the docs is only available since 2.9.2.

    Update:It looks like Wx Version: 0,9921 wxWidgets 2.9.4 doesn't know about it...