Last 5 Posts from 2006/September

Eagle features and some screenshots

Today I updated Eagle in order to implement some user requests:

focus support
now you can use widget.focus() to give it keyboard focus.
buttons with custom images
aside from stock buttons, which have system wide (and themed) icons, you can use your own images. This also respects system's "buttons with icons" (gtk-button-images) settings and thus will not show on Maemo platform.
canvas resize callback
canvas is always placed inside scrolled window (a container with scrollbars) in order to make developer's life easier. But making the window bigger just make the scrolled window bigger, not the canvas contents. With this callback you can then get the available space and resize the internal contents.
As requested by some friends, here follows some screenshots of Eagle applications running on maemo:

Developing GObject-based classes using Emacs

If you do code GObject derivated classes using Emacs and is tired of so much typing, find and replace just to declare some classes, you must like my new set of Elisp functions: gobject-class.el

There are 3 helper functions

gobject-class-header class_name parent_class_name
Inserts in the current buffer the stuff you usually put into header (.h) files. These include common used/recommended C-pre-processor macros, typedefs, structs and G_BEGIN_DECLS and G_END_DECLS
gobject-class-code class_name parent_class_name
Inserts in the current buffer the stuff you usually put into code implementation (.c) files. These include G_DEFINE_TYPE, _class_init(), _init(), _dispose(), _finalize().
gobject-class-generate class_name parent_class_name
This is a combo of the previous, that already split the screen, create the files with gtk/glib name schema. This is what I use most.
You can bind them to some key, like gobject-class-generate to F7 using (global-set-key [f7] 'gobject-class-generate), or just call them using M-x gobject-class-generate

Please notice that both class_name and parent_class_name expects a string with underscores ("_") separating the namespace and other components. Examples: g_object, gtk_tree_view, ...

Maybe you're interested in my .emacs.

Interesting Eagle application

These days I've opted to invest money and went to my bank webpage in order to find the best option. As you can see, the webpage does not offer a good and quick overview of what happens and I don't want to fill my mind with numbers in order to compare options. Some sort/order, highlights and graphs would help me to see the big picture. All right, being a hacker I must admit it's more intersting to write an application than to deal with money... and looking at the web page source code it seems easy enough to parse it and use Eagle to view it.

It took me more to review the python re module, remember regular expression syntax and write the parser than to write the first GUI version, with a simple table (with column sort). In the end, adding graph support was really easy and I did one and my friend Elvis did another one in few minutes, the result (source code, requires Eagle from SVN) is pretty amazing: