"Hello, World."

Dear subset of the LazyWeb who hack on OSX,

I've finally started on the OSX port of XDaliClock. (And there was much rejoicing.) Since this is my first native Mac program, I could use some help figuring out what I'm doing wrong so far.

  • I made a preferences panel, but I still have no clue how I'm supposed to actually hook it up, so that I can read the settings in it and act on them. One of the tutorials I saw seemed to imply that I needed to have both a "DaliClockView" and a "DaliClockController", but I still just follow how this crap works at all.

  • And once that stuff's hooked up, how do I cause the settings to be saved across sessions?

  • When I test the interface from Interface Builder, the color picker dialog has an "Opacity" slider, but in the real application, that slider's not there. Why?

  • I'm confused about the lifetimes of objects, and whether, when, or how I'm expected to increase or decrease the reference counts. Especially the "fg" and "bg" instance variables. Am I leaking stuff? I think I probably am...

  • Calling setMovableByWindowBackground from initWithFrame doesn't seem to do anything (it needs to be called later) so I'm calling it from acceptsFirstResponder, which is clearly bogus. What's the right place for this sort of thing?

  • How do I make the window always stay on top?

  • How do I make the app exit when the window close box is clicked?

  • Is there a more efficient way of taking a 1bpp bitmap and rendering it on a window with a given pair of foreground/background colors than the horrible way I'm doing it (scale the 1bpp bitmap up to a 24bpp pixmap and render that instead)?

The code is here: xdaliclock-2.21alpha.tar.gz. Please don't distribute this yet, but please do take a look at it and tell me what parts I did in a crazy ass-backwards way. The XCode project is in the "OSX" subdirectory.

Tags: , , , ,

documentation that makes me laugh

- (void)finalize

Called by the garbage collector when the receiver is not referenced by other objects.

Note: Garbage collection is not available for use in Mac OS X v10.4, nor in earlier versions.

The garbage collector invokes this method on the receiver before disposing of the memory it uses. When garbage collection is enabled, this method is invoked instead of dealloc.

Available in Mac OS X v10.4 and later.

Tags: , ,