Is it possible to insert check box in the NSTextView? - cocoa

How do i insert a check box in a nstextView?
Customize the NSTextAttachment?
ANY BODY CAN TELL IT?
thanks in advance.

I didn't try it. Maybe it works.
Initialize a check box. Then add it as a subview to the cell. [textfield.cell addSubview:box];

Related

Why is the titlebar overlapping view controller content?

Can anyone tell me why this is happening and how can I fix this? I thought the content is suppose to display after the titlebar, not under it. The only way for me to fix this is to create a new project.
The Button on top is being overlapped by the titlebar. Not sure how that became possible. There's a lot of room for the window to adjust the view controller but not sure why it's not doing that.
Check window properties. You might have enabled “Full Size Content View” property.

How to make NSComboBox lose focus after selection?

I have a combo box in my OSX app and I want it to lose focus right after I change the value selection.
Right now it just stays selected and highlighted after the selection.
Any kind of help is highly appreciated!
Just figured this out myself.
Using NSComboBoxDelegate, I use this method
- (void)comboBoxWillDismiss:(NSNotification *)notification
It's getting called right before the pop-up list is going to be dismissed. Inside that method I'm calling:
[myComboBox setRefusesFirstResponder:YES];
and it does the trick.

label with delete button

I have a UIlabel that is added dynamically to a view.
What i want is a small delete button (custom image I have) to be added
to the top right corner of the label which should basically delete the label when clicked.
Can someone get me started with what kind of trick can be used to achieve this?
Infact I am open to using any other control in place of label.
Thanks a lot in advance,
Prasad.
Just make a button and then when the button is pressed:
- (IBAction)deleteLabelPressed:(id)sender {
[self.labelText setHidden:YES];
}

Remove border from NSScrollView/NSCollectionView

As you can see in the screenshot below, the NSCollectionView I used has some kind of border (the thin gray lines) I want to get rid of. Can somebody tell me how to achieve this? I already tried subclassing the NSCollectionView and tried to overwrite it in the drawRect: by using [[super layer] setBorderWidth:0.0f]; but this did not work.
Searching on Google, SO and the Apple Documentation did not help either. So did anyone achieved this already or knows where I can find an example of how to do it?
Thanks in advance,
Björn
The collectionView is nested in a NSScrollView, which has a borderType property.
You can get rid of the border by simply setting its border type to NSNoBorder.
self.collectionView.enclosingScrollView.borderType = NSNoBorder;
From story board:
Select the scroll view from story board
Then choose no boarder from Attributes Inspector
For Swift 3 :-
collectionView.enclosingScrollView?.borderType = .noBorder

anyone knows the manufacterer of this grid control?

It is amazing.Each combobox cell has specific items(I couldn't show in the picture).
http://up.vatandownload.com/images/f6sq44ycqe34ptw37m42.jpg
Omicron Electronics:
http://www.omicron.at/en/products/pro/secondary-testing-calibration/cmc-156/

Resources