Friday, 26 June 2009

EuroPython 2009



Today I 'ave mainly been thinking about my upcoming trip to Birmingham to attend EuroPython. click
here for more information.

Saturday, 13 June 2009

Google Picks Mercurial

Today I 'ave mainly been noticing that the Google folks have provided Mercurial as an alternative to Subversion. See here for more information.I may even update my online code.

Updating from subversion to mercurial turned out to be easy enough, just go to administer page select source and change repository to mercurial. Also follow the instructions here

On OS X with mercurial 1.2 it was as easy as hg convert, hg update, hg push for source and wiki.

Friday, 12 June 2009

Hide Tkinter Cursor on Linux

Today I 'av mainly been thinking how to enable or disable a cursor in a Tkinter application. I looked at several threads on the internet but none exactly answered my question. This is what I did...

Use gimp to create a 1x1 pixel image.

Save as 1x1.xbm. You will have to export the file. Make sure the X10 box in unchecked and the hot spot box is checked.

The xbm file is readable and looks like:


$ cat 1x1.xbm
#define 1x1_width 1
#define 1x1_height 1
#define 1x1_x_hot 0
#define 1x1_y_hot 0
static unsigned char 1x1_bits[] = {
0x00 };


The code looks like...


from Tkinter import *

root = Tk()
root.configure(cursor='@1x1.xbm white') # turn cursor off
....
root.configure(cursor='arrow_left') # turn it back on


More elaborate options are possible that include a cursor a mask and 2 colors.

Sadly I was unable to make this work on OS X although I am sure it is possible.

On windows the cursor 'no' does the same thing.