Pushing My Buttons

My continuing adventures with composite windows, listboxes, toolbars, and HTMLViewers

I am a happy user of Electric Butterfly’s MaxiToolbarPro. I use it because it makes it so easy to maintain a nice set of cross-platform toolbars, and they look native enough for me on OS X.

And then REALbasic 2005 shipped, with a feature I’ve been waiting for: the HTMLViewer. The HTMLViewer is a platform-native control for rendering HTML. On OS X, it uses WebKit, the rendering engine behind Safari. On Windows, it uses IE. On Linux, it uses Mozilla if available. But I don’t plan to ship a Linux version of Tangelo anyway.

But this great feature comes with a price: on OS X, it can only be used with composite windows. I didn’t think that would be a problem. Of course, I hadn’t used composite windows before, but I didn’t see why it should cause any trouble.

Then the trouble started.

My toolbar buttons would randomly disappear or draw incorrectly. I spent a few weeks going back and forth with Dave from Electric Butterfly, and in the end, we determined that it was a bug in REALbasic itself, that only occurs when using a custom canvas on a composite window with a listbox. Which describes my interface pretty well, actually. Dave was incredibly helpful, but since the bug is in RB, there wasn’t anything more he could do.

Time passed.

I finally decided that instead of waiting for RB to fix the bugs with listboxes on composite windows screwing with the toolbars, that I’d just go ahead and use native toolbars on that window (REALbasic has support for native OS X toolbars, but they’re not cross-platform, of course). No harm done, just a little extra code to shift things around a bit. So I add native toolbar buttons to the window and write a bunch of conditional code to put things in the right places depending on the platform (because Windows is fine, and I can still use MaxiToolbarPro without a hitch). Now it crashes on quit. Every time.

So I narrow it down and discover a conflict between RB’s native toolbar support and the HTMLViewer. Grrr. I filed a bug report and tried to drum up some support on the NUG, but no bites. So start thinking and I remember Thom McGrath wrote some wrapper code for using “real” toolbars, not just the partial RS implementation. I download it, start to add it to my project. Now it won’t compile. Thom’s classes require the app to be Mach-O, one of two executable formats available for Mac OS X (the other being PEF). OK, so I compile it as Mach-O and now it crashes on startup. SQLitePluginPro error. I confirm the bug with Will from SQLabs, but there’s no fix yet. Crap! Well, I’ll just switch to using REALSQLDatabase, the new database engine in RB 2005, since that’s based on SQLite, right? Wrong! REALSQLDatabase is SQLite 3, but SQLitePluginPro is SQLite 2. And they’re not compatible. And there’s no way to migrate without the SQLitePluginPro working. More thinking.

I end up downgrading SQLitePluginPro to 1.1 or something like that, and it starts working on Mach-O. Cool. Finally some progress. But now I hit another problem: using Thom’s HIToolbar classes, I can apply stock Apple icons to my toolbar buttons, but no custom icons. Well, that sucks. So I go back and forth with Thom a bit, and in doing so, I find that it works with RB 5.5.x, which, of course, does me no good since the whole point was to use the HTMLViewer in the first place! After a bit, Thom tells me that RB2005, all of his declares to Quartz need to be declared to Carbon instead. So I change about four or five methods making those declares, and after only three weeks, my window works now!

So, long story short, expect a new Tangelo beta real soon now.

Lying Here, Doing Nothing

This morning, as Jen and I lay in bed, nearly motionless, at an hour far past that which should have seen us up and about, she said, “I feel really lazy, just lying here doing nothing.”

“Hey,” I said. “You’ve earned it. You deserve to lie here doing nothing for a while. Go back to sleep.”

On Thursday morning, I woke up and went about my routine, just like every other weekday. I checked my email, took a quick look at NetNewsWire Lite, shaved, took a shower, gathered my gear, packed my lunch, kissed Jen goodbye, looked in on Grace, and looked in our foster daughter.

But it was the last time I’d look in on her.

The social worker arrived at 2:45 PM, a full fifteen minutes early, to come and take her back to her mother.

I had left work a few hours early so I could be home when she left. Her departure was kind of anticlimactic in the end. The social worker took the baby, strapped her in her car seat, and drove her out of our lives.

Jen, Gracie, and I stood in the front yard for a moment or two and blinked back tears. She was gone. We walked inside and closed the door, and then started cleaning up and packing up baby gear. More tears came, but we were okay.

We had picked up this baby from the hospital when she was two days old, in mid-February. She’d been with us ever since. Now, at just over five months old, she was going back to her mother.

I tried not to get attached. But she wiggled her way into my heart, and she had become my girl, a title I’d previously bestowed upon only Jen and Grace. She knew me, and I could see in her face that she thought I was her Daddy. When I came home from work, she smiled and giggled. She knew my tricks. When I held her up, she arched backward to get me to swing her gently back and scoop her up again. Then she’d smile a crooked smile at me and lean back again. I knew her most ticklish spots, and I knew which of my silly faces made her smile and laugh.

As I stood in the yard and watched her drive away, I wondered what would go through her head as she cried for us. Would she wonder why we weren’t coming? Would she think we’d abandoned her?

The consolation, of course, is bittersweet at best: within a few weeks, she’ll forget all about us.

Last night, Grace went to sleep at my parents’ house so that Jen and I could have the first night to ourselves we’ve had since February. This morning, we slept in, more for Jen’s sake than for mine.

Jen’s the real hero. She was the one who did the late night feedings and diaper changes. She was the one who carted her to the doctor. She was the one who still took care of Grace and me while she took on this baby. She was on who hadn’t had a decent night’s sleep in five and a half months.

So this morning, as Jen and I lay in bed, nearly motionless, at an hour far past that which should have seen us up and about, she said, “I feel really lazy, just lying here doing nothing.”

“Hey,” I said. “You’ve earned it. You deserve to lie here doing nothing for a while. Go back to sleep.”

And she did.