More photos…
Ξ February 23rd, 2009 | → 0 Comments |
∇ Development | ∇ Blogging, Development, Python |
You might have already noticed that the number of photos in my own Experiment photoblog. This increase in the number of photos is due to my vacations (sort of!), but also and specially due to the new Python upload “tool”* I’ve developed during the last week!

The all process was quite simple…
1. Design the interface using Glade-3. This step includes creating the window and placing some controls. My “tool” uses labels, text boxes, buttons, menus and even a status bar (which I didn’t get to use for any status display). Also, the required controls should be connected with event listener which will be customized by the developer. The only listeners the “tool” interface defines is the window_kill for the File -> Quit menu option and on_button1_clicked for the ‘Upload’ button.
2. The previous results in the generation of a window.glade file. In order to use this interface definition, the .glade file needs to be converted to a GTK definition file (e.g. window.xml). This conversion is performed using the gtk-builder-convert (simply execute gtk-builder-convert window.glade window.xml).
3. In order to use the Window.xml definition just create a Python class and build the interface in the constructor. Don’t forget to instantiate the handlers you defined for your interface. Here is an example of my gui.py (before customizing the button listener).
Again, I really find easy to make stuff work using Python.
* - The expression tool appears several times between quotes and in italic because the actual application took no more that a couple of hours to build, so calling it a tool is a bit too much. Moreover, it’s highly hardcoded so it’s not much of a tool… it’s more like a “tool”!



