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.
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.
- Or get the up-to-date version here
5 thoughts on “wxPython: Windows Styles and Events Hunter”
It’s not, but until that happens why not use what you can get?
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.
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):
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.
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)
I’m getting the same traceback running this on my mac
Comments are closed.