CodeToast


Categories


Archives

Meta

ToastControl starts to crawl…

Posted by Nicholas Brookins on 4 June, 2008

I’ve managed to plug away at ToastControl a bit over the last couple weeks, and have some items to report.

Decisions decided

  • - I’m going to use Python. I wanted to use a dynamic language that would be flexible. The heavy lifting is done by the plug-ins like Rdesktop / mstsc and VNC anyway, written in C - the surrounding application doesn’t need tons of speed. Ruby was a contender, but Python seems much more suited to cross-platform thick-client apps like this, at least at the moment.
  • - I’m using the wxWidget library for a cross platform GUI. It is simple to use with Python, has a better look and feel than TkInter, and with less weight and licensing baggage than Qt.
  • - I’ve decided to work on / test with Linux first. I do plenty of Windows Development at work, so this will give me a challenge to keep my interest. Once Linux is complete, porting a Windows version will be a breeze.


State of the application

Most importantly, it’s a running app - a big part of getting excited about building something! Now it may not be as complete as the screenshot would lead you to believe - the connections are hard-coded (only RDP is working so far), and it doesn’t actually know ‘new’ or ‘open’ or ’save’ like the toolbar would indicate, but it is making fast progress. Python has been surprisingly easy to work in after long stints in C# and C++ - if there’s interest I may just write a ‘Getting started in Python for .NET programmers’ tutorial.

I’m using WingIDE for editing - it is commercial, but I haven’t found anything as stable, elegant, and lightweight that was free (but not too lightweight like the included IDLE). If I don’t come with anything better in the eval period I’ll license or steal it. I mean license it. I originally tried also using wxGlade, a GUI designer for wxWidgets that can export to Python, but after getting accustomed to how it all fit together I decided to write the UI by hand: more control and more concise code. I just sometimes have to sketch layouts on paper to get started, since I can’t just drag things around until they fit - which wxGlade wasn’t great for anyway.

One big part I was dreading, going through the rdesktop code to integrate it with my UI, turned out to be a non-issue. Since I had last spent much time with it, rdesktop has added a parameter (”-X”) that takes a window id to embed itself into. All I have to do is launch it in another thread and pass it the id of my panel. Insanely easy, my integration with RDP is now about 20 lines of code. In fact, I should send the rdesktop contributor chocolates. It turned out to be a well written and easy to read program, but I was still pretty relieved - lets hope VNC is as easy.

What comes next?

So here are the biggest items on the radar -

  • - Public source control. I like Subversion and could host it myself, although SourceForge or the like might get more publicity. Anyone have experience there? I’d love to get some collaboration going on this.
  • - More information here on how I’m building it. I just need to get it broken down into article sized chunks and get to writin’.
  • - I need a plug-in system. Python lends itself to pretty easy plug-in implementations, and there are a few complete libraries - although I’d like to keep dependencies to a minimum. Plug-ins will have to not only provide the ability for a new type of connection, they will also need to somehow provide a panel with config options. I haven’t quite yet wrapped my head around how interfaces work in a dynamically typed system
  • - A configuration / settings-persistence system. I’m fond of serialization for this type of thing - making the actual usage as easy as possible. I haven’t spent many brain cycles on it yet, but it seems that Python would work well in a JSON-like format: just spit out Python code that will build the classes to a config file, and when loading it, evaluate the contents.


Expect fast progress from this point, I’m itching to get a usable app that I can start to dogfood…





5 Responses to “ToastControl starts to crawl…”


  1. pythonistic Says:

    Simplistic but effective, look at the built-in SafeConfigFileParser.

    http://docs.python.org/lib/module-ConfigParser.html

    It writes and reads INI style files, I’ll wager sufficient for your needs in this projects.

  2. Nicholas Brookins Says:

    Thanks for the suggestion - I kind of had my heart set on something slick (practical or not :)) - but it turns out Python’s eval isn’t right for the task anyway - it doesn’t seem to be able to set local variables, although I could be missing something.

    This app doesn’t have need of a hierarchical config system, you’re right that a flat INI file would probably work just fine - I’ll look into that module..

  3. sourceforge net Says:

    [...] I wanted to use a dynamic language that would be flexible. The heavy lifting is done by the plhttp://codetoast.com/blog/archives/33Recent Original Stories New Mobile Computing”Regardless of widespread skepticism, I was confident [...]

  4. wxwidgets Says:

    [...] [...]

  5. Issac Maez Says:

    This is great! Thanks for the article. I am new at django and this was a big help.


Leave a Reply