Hi, I'm playing with the HICocoaViewCreate method

so here is a code which I call from the main thread

    HIViewRef rootView = HIViewGetRoot(rootWindow);
    NSRect      buttonRect = NSMakeRect(0,0,150,30);
    NSButton *button = [[NSButton alloc] initWithFrame : buttonRect];
    [button setButtonType:NSMomentaryPushButton ];
    [button setImagePosition : NSNoImage];
    [button setBezelStyle  : NSRoundedBezelStyle];
    [button setKeyEquivalent:@"\r"];
    [button setTitle:@"Cocoa Button"];

    OSErr err = HICocoaViewCreate(button,0,&cocoaView);
    [button release];
    if(err == noErr) {
        HIRect outRect = CGRectMake(100,30,150,30);
        HIViewSetFrame(cocoaView, &outRect);
        err = HIViewAddSubview(rootView, cocoaView);
        HIViewSetVisible(cocoaView,TRUE);
    }

after that I CAN SEE the button in the expected place
but it's "dead": doesn't respond to any event and it's not flashing as a default button (it's just a blue button)
also in the console I can see
2008-04-16 07:09:46.800 Gateways[57273:882b] NSView is wrapped by HIView but drawn out of band

thanks in advance for any help

Dmitry Markman

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to