PDA

View Full Version : Getting started with GUI programming


Animal Farm Pig
04-30-2010, 05:19 AM
I'm GUI phobic. I've always had a hard time with them. Consequently, I mainly write stuff in Python and just run what I need to as a script, or use the interactive interpreter, or make a simple text or CGI interface. I did successfully make an app with a GUI in Tk a couple years ago, and I hated every freaking minute of it.

Nonetheless, I now really want to write something with a GUI. The basic idea is that I will pull in some XML data (http://www.zoklet.net/bbs/showthread.php?p=1807704#post1807704), use it to interact with an ActiveX control (http://www.mapwindow.org/), get some user input, and store data in a database.

So, how do I get started on that?

Since, I have to deal with an ActiveX control, I guess I need to use a Microsoft language. VB.NET seems the more straightforward one to use, unless someone can give me some really compelling reason to get with C#.

I've been going through some of the VB.NET tutorials (, [url=http://msdn.microsoft.com/en-us/library/dd492135.aspx]2 (http://msdn.microsoft.com/library/bb330924.aspx1[/url)). The language and IDE seem pretty straightforward.

I guess my main question is in the development process.

In Python, I would define some classes for accessing and manipulating my data. Then, I fire up the interactive interpreter and make sure all the class's methods work. When (invariably) something goes wrong, I have the ability to look at the internal state of the instance directly from the interpreter. This makes it easier to fix problems. Then, (if I feel like making things user friendly) I might make a text interface that calls the public methods with user input.

Presumably, I should do the same thing for a GUI program. I'll define some classes that sit on top of the data with public methods for interacting with the data. Then, I can call those methods from the GUI elements.

The problem is in the debugging. Is there a straightforward way to test and debug my classes before building the user interface? Are there good ways to determine whether errors are occurring in the GUI layer or in the 'controller' layer? Anyone have tips here?

I welcome any tips, tricks, or thoughts.