Saturday, October 15, 2011

Right! Kornitop PyGTK works for Mac OS X, Linux and Windows too.

Good news for me! Way Python GTK! I know all about wxPython and PyQT plus plus.

My small clipboard and dumb note page Python program works on Lin/Win/OSX without any source changes using GTK!

http://code.google.com/p/kornitop/

Herewith the dump.

Kornitop : Clipboard Notes Manager
Copyright: (c) 2011, Pieter Greyling (http://www.pietergreyling.com)
License : Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)

Simple and corny cross-platform clipboard tracker (to start with...)
Currently built with Python and PyGTK.

You should only need these PyGTK runtimes:
For Mac OSX - http://sourceforge.net/projects/macpkg/files/PyGTK
For Win GTK - http://ftp.gnome.org/pub/GNOME/binaries/win32/pygtk/
For Ubuntu - already there
Others - please check

BEWARE: By design, text entries from the system clipboard are persisted
to a file and reloaded upon restart of the application.

Kornitop began life as Kornitop for Windows programmed in Delphi:
http://www.chileserve.net/component/option,com_joomlaboard/Itemid,73/func,listcat/catid,3/lang,en/
http://www.chileserve.net/component/option,com_joomlaboard/Itemid,73/func,view/id,18/catid,4/lang,en/

I wanted to build an open source version using a cross-platform dynamic language and GUI toolkit.
After much messing around I picked on Python with PyGTK. So far I am pretty happy with this decision.

To get going I used the PyGTK 2.0 Tutorial, section 15.1.5. A Clipboard Example, as a starting point:
http://www.pygtk.org/pygtk2tutorial/
http://www.pygtk.org/pygtk2tutorial/ch-NewInPyGTK2.2.html#sec-ClipboardExample
http://www.pygtk.org/pygtk2tutorial/examples/clipboard.py

==Simple and corny cross-platform clipboard tracker (to start with...)==
Currently built with Python and PyGTK.

2 comments:

  1. Out of curiosity, what made you choose PyGTK, as opposed to (Py)Qt or wxPython? I've been looking at cross-platform GUI toolkits and I'm pretty discouraged by what I've found so far.

    ReplyDelete
  2. I was spending a lot of time on Ubuntu and starting to enjoy the out-of-the-box GNOME experience. PyGTK comes standard and it was pretty easy to create something that just "fitted in". To be honest I also found the PyGTK way of event-to-function/method callback hookup straightforward. I also do not mind identifying an event by a name string, as in:
    self.buttons[i].connect("clicked", self.clicked_cb)

    ReplyDelete