Periodically I get requests to release CCalc for Mac OS X. Also for Unix, but I don’t have any experience with GUI development in Unix, and I’ve heard that CCalc runs fairly well under Wine anyway.

Years ago I began experimenting with OS X development for Console Calculator, as I use OS X personally. To be honest, I can’t stand using Xcode to design an interactive GUI. I find it confusing an non-intuitive for one. The NIB files and Interface Builder seem particularly convoluted with all their controllers, and control-click to drag objects to connect them together. Are events and callbacks so bad?

Even though I had mostly separated the calculator engine from the GUI, it was going to take a LOT of work to get a fully featured OS X version of the GUI and and running.

I started thinking about going with a cross-platform development kit, so I looked into a few. wxWidgets had some nice things going for it, but I also gave FLTK a try and found developing with that toolkit was easier and produced smaller executables.

FLTK stands for Fast Light ToolKit.  It’s free.  Here’s the skinny from their site:

FLTK (pronounced “fulltick”) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL and its built-in GLUT emulation.

FLTK is designed to be small and modular enough to be statically linked, but works fine as a shared library. FLTK also includes an excellent UI builder called FLUID that can be used to create applications in minutes.

I found it really easy to pick up, documentation is good (if you use google to find it, their website is a mess), and their sample applications are great way to learn the ropes.  I had a simple console calculator GUI up and running in just a few hours.  With a cross platform toolkit, I figured the examples wouldn’t work “out of the box” on OS X as they would on Windows, but I was wrong.  Xcode project files were included, and the sample applications compiled right away.  No hours spent to read install READMEs and googling for compile errors.  Nice.

So I spent a few more hours to make it actually a useable program, and released the half-baked version for download.  It’s got the same calculator engine as the Windows version, so it is fully featured in that regard, but no GUI support for changing any of the settings yet, no saved variables or functions.  To get it on par with the Windows version will take many more hours, and unless someone wants to sponsor further development, I’m in no rush.

Try out Console Calculator for OS X.  I would like to hear some feedback from people… the GUI doesn’t use native OS X controls, so it does look a little out of place.  The menu bar is in the application window, etc. Could use some polishing, but works for me.



  1. Gabe on Saturday 2, 2010

    Wow! Hadnt checked the website in a while! So much is new!

    Will be sure to offer feedback shortly on Mac version.

    Many thanks, there is not a calc out there that has anything on yours. Kudos!

  2. Gabe on Saturday 2, 2010

    Does the Mac version have some keyboard shortcuts for changing base binary,dec,hex? I actually dont mind the lack of UI and the math seems robust.

    All I miss is the always-on for engineering suffixes and a way to change base on the fly. The rest is pure candy :)

  3. CCalc on Saturday 2, 2010

    No keyboard shortcuts. Maybe I can try to add the base selection and SCI display options as popup menus in the status bar.

  4. Gabe on Saturday 2, 2010

    Yeah that’d be fine.

    Does not need to be pretty, really. Just practical :)

  5. Isen on Saturday 2, 2010

    I use FLTK very often for making GUI. Could you make your code opensource so that we can help you?