I've got a custom hiview in a window stored in a NIB. The custom
hiview is embedded in just the content hiview of the window. I
HIObjectRegisterSubclass(myclassid, kHIViewClassID, ...), then load
the NIB. In Tiger, my construct proc/event handler is called
correctly. In Leopard, the construct proc/event handler is never
called. On Tiger, I'm using Xcode 2.4.1; Xcode 3.0 on Leopard.
The Leopard install is a fresh install (not an upgrade).
I debugged this using a sample app that Jesper provided and it looks
like this will happen if you're loading the nib file that specifies
the custom class ID before you actually register that class. This
used to work, but in Leopard we go down a different path if the
class isn't already registered and wind up creating a generic
HIObject rather than an instance of your class. That's a bug, and
I'll fix it, hopefully for a Leopard software update. However, until
then, I think you can work around this by registering your custom
classes before loading your nib file. Please try that and let me
know whether it works for you.
But I am already doing a HIObjectRegisterSubclass() first then loading
the nib.
static HIObjectClassRef theClass = NULL ;
if (theClass==NULL) {
status = HIObjectRegisterSubclass(myviewclassid,
kHIViewClassID, 0, myviewhandler,
GetEventTypeCount(eventType), eventType, 0, &theClass) ;
require_noerr(status, exitRegisterClass) ;
}
status = CreateWindowFromNib(nibRef, CFSTR("mywindow"), &window) ;
Is there more to it than this? Again, this works in Tiger.
I verified that I'm not mistakenly loading the window early elsewhere
either. If there's sample code out there that does this, I'm more
than happy to study it. Otherwise, I'll just create the custom view
at runtime.
-Chinh Nguyen
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden