What this gives us is basically a plain old blank Tkinter window, not too exciting. The next thing we are going to do is add create our root menu, before going any further you might want to read the excellent information about menu widgets in PythonWare’s Tkinter introduction. You don’t have to but it’s an excellent source of information.

So far our RSS reader has been completely command-line, which is functional but not as nice as we’d really like to have it. So what we are going to do is integrate the GUI that I created in my two Tkinter GUI tutorials into our RSS application.

If you look at our GUI application you can see that at this point it actually has the basic look that we’ll want, what it doesn’t have is the functionality attached to to GUI. So the first thing that we are going to do is let the user add an RSS site when the press the Add button. We are going to pop up a dialog and let them enter the name of the RSS site and the address of the RSS feed.

In order to do that we are going to have to create a simple dialog. Fortunately Tkinter has a nice simple dialog interface that makes creating simple pop-up dialogs quite easy. It’s not as robust as you might like, but if you really wanted to do something very complicated you could simply create another window in the same way that we created our main window. Since we don’t need anything fancy we”ll use the Simple dialog.

To start we must import the simple dialog into our program, so the following will have to be added to the top of the code:

[code lang=”python”]
import tkSimpleDialog
[/code]

Now we could create create our dialog class in a totally new python file but since it’s going to be pretty simple I decided to keep all together in our one GUI file. The first step in understanding the simple dialog is to read PythonWare’s introduction to the dialog window it will explain all that you need to know to create a simple dialog.

Basically what you need to do is create a class whose parent is the simple dialog:

This post is going to build off of Creating a GUI in Python using Tkinter which introduces the basic elements needed to create a GUI using TKinter. This post will take that introduction a bit further and build a more complex GUI application and use some more widgets.

The GUI that we are going to start creating is the GUI that we will eventually use for the RSS reader that I am creating.

Not much having to do with the RSS reader will happen in this post since we will just be creating the GUI shell, but it will help to explain some of the variable names.

We are going to start off with a simple shell that will hopefully resemble the following layout. We will have RSS sites on the left, then the selected sites RSS story titles on the right, and finally the selected stories text on the bottom.

Up until now we’ve focused on python applications that only run in the command line. For a lot of tasks this is great, but in order to be really impressive we’re going to want to create a GUI for some of our python applications.

There are a lot of python GUI toolkits out there, but for our first application we are going to use Tkinter, which is considered somewhat of a standard right now and is installed when pyhon is installed. Another nice thing about the Tkinter GUI is that it is cross platform and offers a native look and feel on *nix, Windows, and OS X.