• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
HICocoaViewCreate question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HICocoaViewCreate question


  • Subject: HICocoaViewCreate question
  • From: Dmitry Markman <email@hidden>
  • Date: Wed, 16 Apr 2008 07:19:53 -0400

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@hidden)

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:
This email sent to email@hidden


  • Prev by Date: Chained Migration of Leopard CoreData stores
  • Next by Date: Re: binary search trees & binning
  • Previous by thread: Re: Chained Migration of Leopard CoreData stores
  • Next by thread: WebKit+AppleScript+JavaScript
  • Index(es):
    • Date
    • Thread