nstextview

NSTextFinder action on NSTextView

筅森魡賤 提交于 2021-02-18 17:29:09
问题 I'm trying to capture all the NSTextFinderClient calls on my custom NSTextView subclass. The show action is called on my -(void)performTextFinderAction:(id)sender override, but for find next, find previous, etc. it's not called. Any ideas? Thanks! Edit: If you create a new project and drag an NSTextView from interface builder, command-g and command-shift-g (find next and find previous) don't work when the find bar is first responder. Why is this? I need a custom subclass of NSTextView to

NSTextFinder action on NSTextView

孤街浪徒 提交于 2021-02-18 17:28:27
问题 I'm trying to capture all the NSTextFinderClient calls on my custom NSTextView subclass. The show action is called on my -(void)performTextFinderAction:(id)sender override, but for find next, find previous, etc. it's not called. Any ideas? Thanks! Edit: If you create a new project and drag an NSTextView from interface builder, command-g and command-shift-g (find next and find previous) don't work when the find bar is first responder. Why is this? I need a custom subclass of NSTextView to

Auto-Resizing of NSTextView and/or NSScrollView

南笙酒味 提交于 2021-02-07 08:23:00
问题 I have an NSTextView inside an NSView (which is being used by a NSPopover , don't know if that is relevant) that I'm trying to resize automatically and programmatically (cf caption). I have been struggling with a lot of stuff, namely : Looking at NSLayoutManager and usedRectForTextContainer that give me aberrant size values ( usedRectForTextContainer : {{0, 0}, {0.001, 28}} ) Modifying NSScrollView frame , [NSScrollView contentView] , [NSScrollView documentView] Getting rid of AutoLayout I

Auto-Resizing of NSTextView and/or NSScrollView

*爱你&永不变心* 提交于 2021-02-07 08:21:30
问题 I have an NSTextView inside an NSView (which is being used by a NSPopover , don't know if that is relevant) that I'm trying to resize automatically and programmatically (cf caption). I have been struggling with a lot of stuff, namely : Looking at NSLayoutManager and usedRectForTextContainer that give me aberrant size values ( usedRectForTextContainer : {{0, 0}, {0.001, 28}} ) Modifying NSScrollView frame , [NSScrollView contentView] , [NSScrollView documentView] Getting rid of AutoLayout I

Changing size of NSTextView

泄露秘密 提交于 2021-02-07 04:01:18
问题 I am trying to implement an NSTextView which resizes to fit its content. I am trying to make it so it has a maximum amount of lines. Meaning, that when this limit is reached, it will not grow any further and the user will be able to scroll it. There seem to be a lot of people wanting this but I have not found a complete implementation of this. The idea is to take the content size of the NSTextView and resize it so that it matches. I just can't figure out how to set the layout size of the

Changing size of NSTextView

蹲街弑〆低调 提交于 2021-02-07 04:00:08
问题 I am trying to implement an NSTextView which resizes to fit its content. I am trying to make it so it has a maximum amount of lines. Meaning, that when this limit is reached, it will not grow any further and the user will be able to scroll it. There seem to be a lot of people wanting this but I have not found a complete implementation of this. The idea is to take the content size of the NSTextView and resize it so that it matches. I just can't figure out how to set the layout size of the

how to toggle rich text formatting in NSTextView programmatically in cocoa

╄→尐↘猪︶ㄣ 提交于 2021-01-27 11:12:43
问题 I want to toggle rich text formatting in NSTextView. I have tried following: [contentView setRichText:NO]; [contentView setImportsGraphics:NO]; but, that didn't changed the NSTextView content and still allowing to do the text formatting. Please let me know the simple way to toggle/switch rich text formatting in NSTextView just like TextEdit. I already check the "TextEdit" sample project, but it seems to be very hard to find the usable code from it. Thanks 回答1: Found some help from following

how to toggle rich text formatting in NSTextView programmatically in cocoa

梦想的初衷 提交于 2021-01-27 11:11:58
问题 I want to toggle rich text formatting in NSTextView. I have tried following: [contentView setRichText:NO]; [contentView setImportsGraphics:NO]; but, that didn't changed the NSTextView content and still allowing to do the text formatting. Please let me know the simple way to toggle/switch rich text formatting in NSTextView just like TextEdit. I already check the "TextEdit" sample project, but it seems to be very hard to find the usable code from it. Thanks 回答1: Found some help from following