We will use a calculator widget that is already in linuxcnc (master)
We will start with a regular custom widget program that used glade to build the display but this widget is not included in the glade interface.
I found this calculator widget on the net: http://sraji.wordpress.com/2009/09/08/calculator-using-python-and-glade/ I changed the keys a a bit for my use : here is the source code: upload:custom_calculator.zip