wxPython: Windows Styles and Events Hunter

If you’re a long time reader of this blog, then you will know that I really like the wxPython GUI toolkit. Something that seems to stump new wxPython users is how to find out what styles and events each widget has though. It does take some practice to learn how the documentation works, but there’s a nice little program that Andrea Gavana put together that he calls the Windows Styles and Events Hunter. It was released a couple years ago on the mailing list, but I don’t think it was very popular. I use it for answering questions on the wxPython mailing list or on their IRC channel, so I know it’s pretty handy.

Here’s what it looks like in action:

Let’s take a look and try it out!

Using the Windows Styles and Events Hunter

Once you have the application downloaded, all you need to run it is wxPython. I assume you already have that or why would you be reading this? The only other requirements for this program is an open internet connection and you may have to allow it through your firewall. Why? Well, this application is designed to download the information from the wxPython documentation on demand. Once it’s downloaded, it is cached on the hard drive in a pickle file, so technically, you could download all the information and you wouldn’t need an internet connection any more.

Anyway, to use it, you run the application and then double-click on the widget of interest. The Hunter will go out and download or load the information into three tabs: Styles, Extra Styles and Events. Just click on each tab to check out what’s there. And that’s all there is to it! The program really is that easy! It’s almost like it was designed by Apple or something.

Wrapping Up

I’ll be writing up another article soon on another great little utility that you can use to learn wxPython and understand it better. In the meantime, check this one out. I’ve uploaded the Windows Styles and Events Hunter here so you can download it from this blog directly.

Download

5 thoughts on “wxPython: Windows Styles and Events Hunter”

  1. I agree that it should be used as there is no better alternative, and I was happy to learn about this utility from your post. But this causes me to worry about the state of the entire wxPython project, if people have to resort to making unofficial utilities instead of fixing the documentation.

  2. A while back I had tried to raise some interest about an improved documentation by providing my version of the docs here (generated with Sphinx):

    http://xoomer.virgilio.it/infinity77/wxPython/APIMain.html

    Unfortunately, after a long discussion, it was dismissed because it required too much maintenance. The problem is, the wxPython docs are generated and inherited from the wxWidgets one (and currently created with Doxygen and epydoc): until project Phoenix comes to life, there isn’t much we can do. If Phoenix comes to life, then applying Sphinx to the real Python docstrings for all the wxPython widgets will be a breeze.

  3. I get the following error when I doubleclick on a widget/event:

    Traceback (most recent call last):
      File “C:Python26ArcGIS10.0libsite-packageswx-2.8-msw-unicodewx_core.py”, line 14660, in
        lambda event: event.callable(*event.args, **event.kw) )
      File “EventsInStyle.py”, line 963, in LoadData
        self.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, None, self.centerPanel)
      File “C:Python26ArcGIS10.0libsite-packageswx-2.8-msw-unicodewx_core.py”, line 3917, in Bind
        assert callable(handler)
    AssertionError

Comments are closed.