October 31, 2003
§ ¶NodeStore takes its first breath
Here's a screenshot of a simple little TreeView and its source code using my new node-based Store for Gtk.TreeView. The GtkTreeModel implementation is stable enough to render trees now.
I still need to think through signal emission for node updates/additons/etc... Also left on the ToDo list are the TreeSortable interface, DnD, and customizations for the TreeView and TreeSelection APIs.
October 29, 2003
§ ¶Momentum
I'm closing in on a new TreeStore implementation. Hopefully I'll be testing some simple models tomorrow.
Hot on the heels of yesterday's release, we now have binaries up for RH8, RH9, (now that I've got my laptop up to RH9, I can support both) and a win32 installer thanks to Daniel Morgan and Johannes Roith. Way to go guys on the fast turnaround. We haven't had win32 binaries on the project download site since way back in the day, release 0.6. It'll be interesting to see how many hits that package gets, as I'm really intrigued about the size of our win32 user base.
October 28, 2003
§ ¶Release day
Realized this morning that it had been almost 6 weeks since the last Gtk# release. With 470 new lines in the ChangeLog, I decided to put TreeView hacking on hold for a day to crank out some rpms and a tarball. It's an impressive release, based on the number of bugfixes in the ChangeLog.
October 25, 2003
§ ¶Tree Monkey
We've been getting a lot of questions about the TreeView API. It is one of the more challenging APIs in Gtk to get the hang of. One of the issues is that the API uses a lot of C-isms, like ellipsis parameters, and string based argument lists, which are hard to wrap in C#.
I have started to lay out the beginnings of an API that utilizes the GtkTreeView C API but exposes a C# face. It's still very much in the brainstorming/prototyping phase.
To expose model data to the tree, you would define a node type:
[TreeNode(ColumnCount=3)]
public class MyTreeNode : TreeNode {}
The idea here is to tag a potentially existing data type with an attribute to identify Tree related aspects of the type. TreeNode will be an abstract base type that implements a new ITreeNode interface to expose the navigational aspects of tree nodes. If you are creating a new tree from scratch, subclassing TreeNode will simplify the implementation, but you can implement the ITreeNode interface directly on more complex data types that are also used outside of the tree context.
To mark the column values, a couple of mechanisms will be available:
[TreeNodeValueList]
public IList Columns { get { return cols as IList; } }
A property marked with the TreeNodeValueListAttribute would indicate an IList of column values. This would make it easy to create tree-specific data types.
[TreeNodeValue(Column=2)]
public string PicklingAgent { get { return agent; } }
The alternative would be to tag a property as an individual column value, which would make it easier to create multiple purpose data structures for tree and alternative uses.
To instantiate a store will be as simple as:
TreeStore store = new TreeStore (typeof (MyTreeNode));
Anywhere in the existing TreeView api where iters are utilized, the new API will use ITreeNodes, allowing the user to manipulate nodes directly. At least that's the plan...
October 18, 2003
§ ¶Sunburn in October
I'm a trustee and active member of a dog training club. This morning I went to a local forest preserve to plot a track that I'll be putting in tomorrow morning for the club's AKC TDX test. Normally we're done with our preparations in 2-3 hours, but for varying reasons, today it took 7. Which, shall we say, sucked.
This week I spent most of my hacking time fixing Gtk# bugs. Lots of bugs. One of the fixes was to add metadata support to move nodes in the API XML. With the new XPath engine, this was rediculously easy. Literally a 10 minute hack. So now all the gtk_paint_* method wrappers live on Gtk.Style, where they belong.
I also fixed the bug where things got ugly fast when you called Destroy() on Gtk.Window subclasses. So everyone can now remove all those Hide() workarounds they had in their code.
October 13, 2003
§ ¶Holiday
About 3PM today, I realized that it was a Ximian holiday. In other words, I just worked straight through a 3 day weekend. Oh well, Thanksgiving is just around the corner.
Today, I killed the oldest living bug in Gtk#, 3 days after the critter's first birthday. We've been using metadata to manually mark "out" params for simple types since this bug was opened.
With the patch today, about 300 more parameters are now automatically marked as "out" params. Any simple pointer types are now marked "out" unless there is an array tag or an pass_as tag in the XML. Now we just have to audit and mark the array and ref params.
October 12, 2003
§ ¶Alterations to alterations
A few weeks ago, Alp Toker of Mono for debian fame suggested that an XPath based system for doing API changes might lower the barrier to entry for API patch submissions for Gtk#. At the time, I kinda shot it down because Alp didn't seem excited about trying to convert the existing metadata over, and I didn't want to have to maintain two systems.
During my bug fixing crusade of the last week, I had to add a bunch of metadata. It got me thinking again about Alp's suggestion, and how we might be able to get more people involved in the API fixing so I could focus more on the parser and generator. This weekend, I wrote a simple little XPathNavigator engine and converted over a bunch of the metadata files. The new metadata node structure looks like:
<metadata>
<attr path="xpath_to_element" name="attr_name">attr_value</attr>
</metadata>
To change the name of the AtkDocument.GetDocument method, the attr rule looks like:
<attr path="//interface[@cname='AtkDocument']/method[@name='GetDocument']" name="name">GetTheDocument</attr>
The GAPI::Metadata perl module will probably die when I get the last two metadata files converted over, because this is just clearly more usable and extensible. It will be trivial, for instance, to create a new metadata element type to perform element moves, so that we can move the Gtk.Paint methods into Gtk.Style where they belong. I was not looking forward to updating the perl module to do tasks like this.
Another side benefit of the changes is that I have moved the metadata alteration step back until during the code generation phase. This means that it is now possible to make a metadata change without having all the source installed and rerunning the parser. Oh yeah, the metadata files are around 30% smaller, too
October 10, 2003
§ ¶Working the list
I've been feeling the Gtk# love lately. Mostly people seem to be happy to see their long outstanding bugs getting fixed. I think everyone thought I was blowing them off before when I kept pointing them to bugzilla from the mailing list.
Most weeks I had less than 2-3 hours to work on Gtk#, and I spent most of it reading email. There was no way I could stay on top of it with that little availability. Bugzilla kept filling, and every few months I'd take a look and see if there was anything easy to knock off.
Working on Gtk# full-time has given me the ability to dig in, and the list is shrinking by the day. So keep kicking those tires and keep those bug reports coming!
October 08, 2003
§ ¶Don't quit yer dayjob
A lightswitch in the bathroom of our 30 year old house went flaky and finally failed on us yesterday. Since the box containing the switch also had a single outlet with a fan switch occupying the place where a second outlet could be, I decided to rip out the whole mess and replace it with a dual switch and dual receptacle.
After hooking everything back up and turning on the breakers, of course, none of it worked. Realizing my limitations, I went back to debugging Gtk# and called my buddy Bill, an electrical contractor. He determined that the green wire wasn't a ground wire (probably faded from being blue at one point), I'd improperly identified the hot source wire, and that the circuit to the GFCI breaker on my panel was really the unused wires in the back of the box. In my defense, those wires were unused when I started, too.
The good news is that I exterminated several more Gtk# bugs in the hours it would've taken me to figure out what it took Bill 5 minutes to fix. And it only cost me a double cheeseburger. Of course, next time his business LAN breaks down, my phone will be ringing...
October 07, 2003
§ ¶$100 Hotdogs
The local hotdog stand just happens to sit right next door to a hobby shop that carries a fair amount of N scale model railroad goodies. I have this bad habit of going out for a hotdog and coming home with more than food. Today was no exception, as a shipment of Atlas PS-2 covered hoppers recently arrived.
October 06, 2003
§ ¶Independence
Today I successfully generated and compiled a standalone gtkhtml-sharp.dll. I'll be checking in the changes tomorrow. This relocation of the gtkhtml binding will allow its gnome-print related methods to be unhidden.
I've added --outdir, --customdir, and --assembly-name arguments to the generator. If you don't provide them, they default to the old hard-coded values. Many of the recent changes have been aimed at making it easier to add such options in the future to both the parser and generator.
October 03, 2003
§ ¶Generate
I'm currently refactoring the code generator to make it easier to add new functionality. When I wrote the generator, I hardcoded quite a few things (path information, assembly names, etc...) Now this is starting to bite us, because we can't do things like have the Gtk.HTML class live in a gtkhtml-sharp.dll assembly. It needs to be broken out of gtk-sharp.dll since it depends on a lot of GNOME stuff.
I'm trying to follow the Refactoring paradigm of making small changes and testing often to ensure no regressions. I cooked up a really simple regression "suite" by writing scripts which extract the generated source from the gtk-sharp source tree. I store a baseline of the source and can do recursive diffs against it to see if anything has changed. It works great for refactoring because you don't want to see any code drift.
October 02, 2003
§ ¶Beginning
Looks like I'm going to be getting some time to work on Gtk# for a while thanks to my incredible employer, Novell/Ximian. I'm excited about getting more time to take it the next step. Gtk# has been completely volunteer for me for the last 2 years, and as such has suffered from competition with my wife, the dogs, and my half dozen or so other hobbies.

