Programming Articles

GTK+ Threading

Published: Tuesday, 20 July 2010 13:13

I've just been working with GTK+, a GUI toolkit for C/Linux - but ported to pretty much everything. Initial impressions are quite good, although I am starting to miss Qt/Creator. Anyhow, I hit the age-old problem quite quickly. The GUI thread just isn''t enough. To start with, I just slapped in a 'normal' thread (pthread_t) but when the time came to update the GUI, things started to go pete tong. Here is how I sorted it.

Using X-Macros to manage a command interface

Published: Friday, 25 June 2010 12:29

Command interfaces are essential to embedded systems and any applications without a GUI. This article will introduce X-Macros as a means of creating a clean and tidy command parser, which I regularly use in systems to respond to serial and ethernet requests. X-Macros are a way of using the C and C++ preprocessor which results in code 'writing itself' in a pre-defined manner, perfect for repetitive but subtly different programming tasks.