search control with pop-up

Hi guys,

Longtime wxPython devotee, first time poster. I'm looking for a widget
that does search. I want to be able to recreate the experience of
going to Facebook, typing a name and getting a list of names pop up in
real-time underneath the search box. Any thoughts? Did I miss
something obvious? I poured over Noel and Robin's dog-eared book and
didn't see anything like this (nor online, nor through infiniti 77's
widgets).

Take care,
BERNiE

Bernie Hogan
Research Fellow, Oxford Internet Institute
University of Oxford

There is wxSearchCtrl for the input part of the search, and then you
could show a wxPopupWindow or just a regular frame to show the
results.

Che

···

On Fri, Jul 31, 2009 at 4:30 PM, Bernie Hogan bernie.hogan@gmail.com wrote:

Hi guys,

Longtime wxPython devotee, first time poster. I’m looking for a widget

that does search. I want to be able to recreate the experience of

going to Facebook, typing a name and getting a list of names pop up in

real-time underneath the search box. Any thoughts? Did I miss

something obvious? I poured over Noel and Robin’s dog-eared book and

didn’t see anything like this (nor online, nor through infiniti 77’s

widgets).

Take care,

BERNiE

Bernie,

···

On Jul 31, 3:30 pm, Bernie Hogan <bernie.ho...@gmail.com> wrote:

Hi guys,

Longtime wxPython devotee, first time poster. I'm looking for a widget
that does search. I want to be able to recreate the experience of
going to Facebook, typing a name and getting a list of names pop up in
real-time underneath the search box. Any thoughts? Did I miss
something obvious? I poured over Noel and Robin's dog-eared book and
didn't see anything like this (nor online, nor through infiniti 77's
widgets).

Take care,
BERNiE

You forgot to check the wiki. There's a tutorial/custom control on
there for one way to do this:

http://wiki.wxpython.org/TextCtrlAutoComplete

Hopefully that will give you some ideas.

Mike

Thanks everyone,

That widget works great...on XP.

My colleague and I work primarily on Macs.

So I've been following various discussions talking about how
wx.PopupWindow was available on windows but not mac. That was two
years ago. It was comitted to the wxWidgets then, and theoretically
going to be in wxPython 2.9.

In one of the threads it mentioned a window in macPopupWindow in
notebookctrl.
see: ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

I tried it - it is not a feature complete parallel of popup window
since it is designed primarily to show tool tips rather than a full
listctrl, so it doesn't do a nice job of binding events in the
listctrl. I'll try to beat it into shape, but I was hoping for
something as out of the box as TextCtrlAutoComplete is on windows.

So -
a. How can I get my hands on a beta version of wxPython 2.9 for Mac
or
b. Does anyone have a better solution/alternative?

Take care,
BERNiE

···

On Aug 3, 5:04 pm, Mike Driscoll <kyoso...@gmail.com> wrote:

Bernie,

On Jul 31, 3:30 pm, Bernie Hogan <bernie.ho...@gmail.com> wrote:

> Hi guys,

> Longtime wxPython devotee, first time poster. I'm looking for a widget
> that does search. I want to be able to recreate the experience of
> going to Facebook, typing a name and getting a list of names pop up in
> real-time underneath the search box. Any thoughts? Did I miss
> something obvious? I poured over Noel and Robin's dog-eared book and
> didn't see anything like this (nor online, nor through infiniti 77's
> widgets).

> Take care,
> BERNiE

You forgot to check the wiki. There's a tutorial/custom control on
there for one way to do this:

http://wiki.wxpython.org/TextCtrlAutoComplete

Hopefully that will give you some ideas.

Mike

Hello,

So -
a. How can I get my hands on a beta version of wxPython 2.9 for Mac

Checkout wxPython svn trunk and wxWidgets 2.9 branch and build from source

Checkout and build instructions can be found on the website.

or
b. Does anyone have a better solution/alternative?

I have a pure python solution that works well cross platform that can
be found in Editra (Editra/src/ed_cmdbar.py) which uses the search
control and a popup listbox that could probably be pulled out and used
without much effort.

Cody

···

On Tue, Aug 11, 2009 at 12:26 PM, Bernie Hogan<bernie.hogan@gmail.com> wrote:

Thanks!

You know, I actually came up with a pretty simple solution in
TextCtrlAutoComplete, although I cannot yet vouch for its robustness,
but it seems fine. Simply replace
self.dropdown = wx.PopupWindow( self ) #line 103

with:
self.dropdown = wx.Frame(self, id=-1, style=wx.FRAME_NO_TASKBAR|
wx.STAY_ON_TOP)

I'm adding it to the wiki as well.

Thanks all,
BERNiE

···

On Aug 11, 6:35 pm, Cody Precord <codyprec...@gmail.com> wrote:

Hello,

On Tue, Aug 11, 2009 at 12:26 PM, Bernie Hogan<bernie.ho...@gmail.com> wrote:

> So -
> a. How can I get my hands on a beta version of wxPython 2.9 for Mac

Checkout wxPython svn trunk and wxWidgets 2.9 branch and build from source

Checkout and build instructions can be found on the website.

> or
> b. Does anyone have a better solution/alternative?

I have a pure python solution that works well cross platform that can
be found in Editra (Editra/src/ed_cmdbar.py) which uses the search
control and a popup listbox that could probably be pulled out and used
without much effort.

Cody

Bernie Hogan wrote:

Thanks everyone,

That widget works great...on XP.

My colleague and I work primarily on Macs.

So I've been following various discussions talking about how
wx.PopupWindow was available on windows but not mac. That was two
years ago. It was comitted to the wxWidgets then, and theoretically
going to be in wxPython 2.9.

In one of the threads it mentioned a window in macPopupWindow in
notebookctrl.
see: ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

I tried it - it is not a feature complete parallel of popup window
since it is designed primarily to show tool tips rather than a full
listctrl, so it doesn't do a nice job of binding events in the
listctrl. I'll try to beat it into shape, but I was hoping for
something as out of the box as TextCtrlAutoComplete is on windows.

So -
a. How can I get my hands on a beta version of wxPython 2.9 for Mac

Currently you'd need to build it yourself from the SVN code[1], although I hope to be ready to do some preview builds within a few weeks.

[1] Use the wxPython/trunk and the wxWidgets/branches/WX_2_9_0_BRANCH together.

or
b. Does anyone have a better solution/alternative?

I've had good luck on the Mac with using a wx.Frame with a style of wx.POPUP_WINDOW. This is a Mac-specific hack, and I think that style flag is just ignored on the other platforms, so you'll need to make your code be conditional based on the platform and the version. (In 2.9+ you'll be able to use wx.PopupWindow on the Mac too.)

···

--
Robin Dunn
Software Craftsman

Thanks everyone thus far.

Geez, I had no idea what I was getting into...I've given a thought to
building and got as far as making the wxWidgets, and the wxPython
build failed with the following error:

Hints(PyObject*, PyObject*, PyObject*)’:
src/osx_carbon/_core_wrap.cpp:61681: warning: ‘SetVirtualSizeHints’ is
deprecated (declared at /Users/bernie/Desktop/wxWidgets/include/wx-2.9/
wx/sizer.h:651)
lipo: can't open input file: /var/tmp//ccqpbXB1.out (No such file or
directory)
error: command 'gcc' failed with exit status 1

And I'll level with you - I don't know what I'm doing here. I can't
recall the last time I built anything.

Why did I even bother? Recall I'm trying to get a TextCtrlAutoComplete
working on a mac. I substituted wx.Frame for wx.PopupWindow. This
seemed alright at first, but unlike wx.PopupWindow, wx.Frame does a
fine job of stealing focus and being fussy about it. I've retooled the
event handlers a bit and nothing seems to get the right behavior. So I
figured, why not spend the night building wxPython! Fail.

(There's a secondary issue that wxPython after 2.8.5 doesn't seem to
play nice with pyFacebook - that package requires the window to push
the focus over to a browser and log in. in 2.8.10 it fails, and I'm
not even sure if that's fixed, so it might have been for naught
anyway).

So I'll cope with the wonky wx.Frame behavior on a mac and patiently
wait for the next build.

Take care,
BERNiE

Bernie Hogan
Research Fellow, Oxford Internet Institute
University of Oxford

···

On Aug 11, 8:37 pm, Robin Dunn <ro...@alldunn.com> wrote:

BernieHogan wrote:
> Thanks everyone,

> That widget works great...on XP.

> My colleague and I work primarily on Macs.

> So I've been following various discussions talking about how
> wx.PopupWindow was available on windows but not mac. That was two
> years ago. It was comitted to the wxWidgets then, and theoretically
> going to be in wxPython 2.9.

> In one of the threads it mentioned a window in macPopupWindow in
> notebookctrl.
> see:ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.

> I tried it - it is not a feature complete parallel of popup window
> since it is designed primarily to show tool tips rather than a full
> listctrl, so it doesn't do a nice job of binding events in the
> listctrl. I'll try to beat it into shape, but I was hoping for
> something as out of the box as TextCtrlAutoComplete is on windows.

> So -
> a. How can I get my hands on a beta version of wxPython 2.9 for Mac

Currently you'd need to build it yourself from the SVN code[1], although
I hope to be ready to do some preview builds within a few weeks.

[1] Use the wxPython/trunk and the wxWidgets/branches/WX_2_9_0_BRANCH
together.

> or
> b. Does anyone have a better solution/alternative?

I've had good luck on the Mac with using a wx.Frame with a style of
wx.POPUP_WINDOW. This is a Mac-specific hack, and I think that style
flag is just ignored on the other platforms, so you'll need to make your
code be conditional based on the platform and the version. (In 2.9+
you'll be able to use wx.PopupWindow on the Mac too.)

--
Robin Dunn
Software Craftsmanhttp://wxPython.org