GUI Toolkits

wxPython: How to Get Selected Cells in a Grid

Today we will be looking at how to get the selected cells from a wxPython grid object. Most of the time, getting the section is easy, but when the user selects more then one cell, getting the selection becomes more complicated. We will need to create some sample code to show how all this fits […]

wxPython: How to Get Selected Cells in a Grid Read More »

wxPython: An Introduction to SplitterWindows

The wxPython GUI toolkit comes with lots of widgets. We will be covering some widgets that are somewhat harder to get ones mind wrapped around. In this case, we will be talking about splitter windows. WxPython includes three types of splitter windows: wx.SplitterWindow fourwaysplitter which you can find in wx.lib.agw MultiSplitterWindow which you can find

wxPython: An Introduction to SplitterWindows Read More »

wxPython: How to Update a Progress Bar from a Thread

Every now and then, I see someone wondering how to create a progress bar and update it. So I decided to whip up an example application that updates a progress bar (technically a wx.Gauge widget) from a thread. In this tutorial, we will create a frame with a button. When the button is pushed, it

wxPython: How to Update a Progress Bar from a Thread Read More »

wxPython: How to Redirect Python’s Logging Module to a TextCtrl

Today I was reading the wxPython Google group / mailing list and there was someone asking about how to make Python’s logging module write its output to file and to a TextCtrl. It turns out that you need to create a custom logging handler to do it. At first, I tried just using a normal

wxPython: How to Redirect Python’s Logging Module to a TextCtrl Read More »

wxPython: Creating a Grid with XRC

I recently tried to help someone (on the wxPython mailing list) figure out how to use a Grid widget (wx.grid.Grid) via XRC. It should be simple, but if you run the code below, you’ll discover a weird issue: import wx from wx import xrc ######################################################################## class MyApp(wx.App): def OnInit(self): self.res = xrc.XmlResource(“grid.xrc”) frame = self.res.LoadFrame(None,

wxPython: Creating a Grid with XRC Read More »

Using Python to Teach About Finding the Digital Root

My wife teaches 3rd grade math and she recently learned about the process of obtaining the digital root of numbers. The digital root is a single digit number found by summing the individual digits. So for 15, you would add 1+5 to get 6. Thus 6 is the digital root of 15. The trainer that

Using Python to Teach About Finding the Digital Root Read More »

PySide: Standard Dialogs and Message Boxes

The PySide GUI toolkit for Python has several standard dialogs and message boxes that you can use as-is. You can also create custom dialogs, but we’ll be saving that for a future article. In this post, we will cover the following dialogs: Color Dialog File Dialog Font Dialog Input Dialog Print & Print Preview Dialogs

PySide: Standard Dialogs and Message Boxes Read More »

PySide: Connecting Multiple Widgets to the Same Slot

As I learn PyQt and PySide, I am writing some tutorials to help my fellow travelers. Today we’ll be looking at how to connect multiple widgets to the same slot. In other words, we’ll be binding the widgets signals (basically events) to slots (i.e. callables like functions, methods) which are better known as “event handlers”.

PySide: Connecting Multiple Widgets to the Same Slot Read More »

PyDev Starts a Crowdsourcing Campaign on Indiegogo

Fabio Zadrozny, the primary developer behind PyDev has started a campaign on Indiegogo to fund continuing development of PyDev. In case you’re new to Python development, PyDev is a plugin for Eclipse that provides a nice Integrated Development Environment (IDE) for Python, Jython and IronPython in the Eclipse environment. You can read about why Fabio

PyDev Starts a Crowdsourcing Campaign on Indiegogo Read More »

wxPython: How to Double-click an Item in an ObjectListView Widget

This week, I needed to figure out how to attach an event handler that would fire when I double-clicked an item (i.e. row) in an ObjectListView widget that was in LC_REPORT mode. For some reason, there isn’t an obvious mouse event for that. There is an EVT_LIST_ITEM_RIGHT_CLICK and an EVT_LIST_ITEM_MIDDLE_CLICK, but nothing for LEFT clicks

wxPython: How to Double-click an Item in an ObjectListView Widget Read More »

wxPython: How to drag and drop a file from your app to the OS

Today on StackOverflow I saw someone who wanted to know how to drag a file from a wx.ListCtrl onto their Desktop or somewhere else in the file system. They were using the file manager skeleton from zetcode, but couldn’t figure out how to add the DnD portion. After a bit of searching and hacking, I

wxPython: How to drag and drop a file from your app to the OS Read More »

wxPython for Python 3 is Almost Here!!!

Robin Dunn, creator and mastermind behind wxPython, announced today on his blog and the wxPython-dev mailing list that he had gotten wxPython 2.9 (Phoenix) to build successfully for Python 3.2 on Mac. In fact, he posted a Quicktime video that shows the build and the tests running in Python 3! According to wxPython-dev, once they

wxPython for Python 3 is Almost Here!!! Read More »

eBook Review: Modern Tkinter for Busy Python Developers

I recently bought Modern Tkinter for Busy Python Developers by Mark Roseman from Amazon and just finished it yesterday. I think it’s pretty new, but I can’t find the release date for it now. Anyway, let’s get on with the review! Quick Review Why I picked it up: I bought this book because I’d been

eBook Review: Modern Tkinter for Busy Python Developers Read More »