Wednesday, January 17, 2007

Get indi!!!

The beta 3 product of indi is now available. indi is a great tool for communicating with friends and groups in a simple, easy, and fun way.

Friday, November 24, 2006

Debugging with large integers

This is just a testimony to my ignorance; but I spent a lot of time trying to debug an OSX application that was using large unsigned integer (UInt64) values. I was trying to printf the values so I could see what they were at specific points in the application and I was always getting 0 as the result. The problem was that I was using a %d in the format specifier string which is desigated for integers; but since these were 64 bit values, that designator was unable to format them properly. Using the %lld specifier was what did the trick. In addition to requiring different format specifications for printing, 64 bit values also require different methods for performing other seemlingly simple operations. For example, to compare two unsigned 64 bit values it was necessary to use the U64Compare() function. There are various other functions for working with 64-bit integers. This was probably obvious for a lot of other folks, but it was a good lesson for me to learn.

Wednesday, October 04, 2006

Managing Z-Order of windows on OSX with groups

I was recently working on an application in OSX that required me to use multiple WebViews in an overlay configuration. This problem ended up being more difficult than I first anticipated because of the way OSX manages windows. After unsuccessfully trying to order multiple views in the same window, I decided to approach the problem using window groups. After searching the web for a while, I hit upon the following combination of commands that allows you to group multiple windows together and have them retain their Z-order


WindowGroupRef parentWindowGroup = GetWindowGroup (hostWindowRef);
CreateWindowGroup (kWindowGroupAttrSelectAsLayer | kWindowGroupAttrMoveTogether | kWindowGroupAttrLayerTogether | kWindowGroupAttrSharedActivation | kWindowGroupAttrHideOnCollapse, &windowGroup);
SetWindowGroupParent (windowGroup, parentWindowGroup);
SetWindowGroup (hostWindowRef, windowGroup);
SetWindowGroup (childWindow1Ref, windowGroup);
SetWindowGroup (childWindow2Ref, windowGroup);

It is important is that you create your childWindows with the following attributes:
kWindowNoActivatesAttribute | kWindowDoesNotCycleAttribute
and that you set the ActivationScope :
SetWindowActivationScope (childWindowRef, kWindowActivationScopeAll);
Also using the kOverlayWindowClass for the "child" windows seems to help.

The full text of this post can be found at:
http://www.kvraudio.com/forum/viewtopic.php?p=1057433