• 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
Round NSButtonCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Round NSButtonCell


  • Subject: Round NSButtonCell
  • From: Greg Hulands <email@hidden>
  • Date: Sat, 13 Jul 2002 18:37:36 +1000

Hi,
I am implementing a Subclass of NSTextFieldCell so that I have a text field
and a round button to the right of the text field. I am having a problem
with getting the button to "click" properly. I catch the mouse down event
and make sure it is within the bounds of the button cell and if it is I then
call this method:

- (void) _didClickInRect: (NSRect)cellFrame
ofView: (NSView *)controlView
{
// We can not use performClick: on the button cell here as
// the button uses only part of the bounds of the control view.
NSWindow *cvWin = [controlView window];
[_remove highlight: YES
withFrame: QButtonCellFrameFromRect(cellFrame)
inView: controlView];
[cvWin flushWindow];
[_remove highlight: NO
withFrame: QButtonCellFrameFromRect(cellFrame)
inView: controlView];
[cvWin flushWindow];
}

The problem is that it does not "click" properly. It just moves the button
slightly as if it were nudged.

I have set the button cell up as follows:
_remove = [[NSButtonCell alloc] initTextCell:@"-"];
[_remove setBezelStyle:NSCircularBezelStyle];
[_remove setButtonType:NSMomentaryPushButton];
[_remove setHighlightsBy:NSPushInCellMask];
[_remove setImagePosition:NSNoImage];
[_remove setBordered:YES];
[_remove setTarget:self];
[_remove setAction:@selector(remove:)];

I would like to know the correct parameters to pass to the button cell so
that when it "clicks" it displays correctly.

Any help is greatly appreciated.

Regards,
Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Getting the contenst of a mount point with a NSFileWrapper
  • Next by Date: Re: Getting the contenst of a mount point with a NSFileWrapper
  • Previous by thread: Re: Stupid question -- where is objc.h?
  • Next by thread: Re: Round NSButtonCell
  • Index(es):
    • Date
    • Thread