Re: Discovering host to use in rootProxyForConnectionWithRegisteredName:host:
I got my terminology mixed up. Wherever you see local domain substitute domain of the computer vending the distributed object On Dec 28, 2008, at 2:58 AM, Ken Tozier wrote: Hi I'm trying to set up a distributed object client, but can't see any way to get the local domain (not localhost) to use in rootProxyForConnectionWithRegisteredName:host: The documentation for NSConnection states that: The host name. The domain name hostName is an Internet domain name (for example, sales.anycorp.com). If hostName is nil or empty, then only the local host is searched for the named NSConnection object. But it doesn't offer any info for the presumably common case where you know the registered name and know it is on the local domain, but is not localhost. I looked into NSNetServiceBrowser's searchForServicesOfType: inDomain: to find the known service name but that requires that you know the service type. NSConnection, of course makes no mention of what type it registers distributed objects, so it seems, at least from available documentation, that you are forced to hard code in domains. I'm sure this must be just a documentation bug, so how does one discover the local domain? Thanks for any help ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/kentozier%40comcast.net This email sent to kentoz...@comcast.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: How do I include a URL in a preprocessed Info.plist?
On Dec 27, 2008, at 7:37 PM, Graham Cox wrote: Anyway, that's useful info, at least it explains what I'm seeing. I worked around it in a different way in the end - I added a user- defined setting for my URL then just used ${MY_URL} in the plist. That worked fine - this is similar to Phillipe's suggestion. I know you found a way to do this that works for you, but I just wanted to point out that you can also just put it into the InfoPlist.strings file(s) and it'll work just fine (and, in the case of Sparkle, allows you to have different URLs for different localizations if you want to do that). Just so I'm clear here, I mean putting the key into the InfoPlist.strings file(s) rather than into the Info.plist file. This will work for almost any key you want to use, as long as you (or the underlying API) is using -objectForInfoDictionaryKey to look up the keys. -- Darkshadow (aka Michael Nickerson) http://www.nightproductions.net ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Find with Nonspacing_Mark
I have a NSTextView which contains บุ that is: THAI CHARACTER BO BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a vowel. When I use the Find Panel to search for บ (using Contains or: Starts with) nothing is found. Same in TextEdit; same with any character + Nonspacing_Mark. When I enter a + COMBINING DIAERESIS and search for ä (LATIN SMALL LETTER A WITH DIAERESIS) the character, which looks like ä is found. Searching for a does not find it. This makes some sense. But to treat นุ as one letter is just plain silly and quite wrong. How can I tell the Find Panel (or the NSTextView) to find my characters, even if they are followed by some other character? 10.5.6 Kind regards, Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Modify appearance of NSSegmentedControl
I have an NSSegmentedControl with segmentCount = 1, segmentStyle = NSSegmentStyleSmallSquare (used in a Toolbar). When the NSSegmentedControl has state = NSOnState, the backgroung is light gray with black text. I want to have a dark gray background with white text. (Same as a Round Textured NSButton with Mode = On Off). How can this be done? I tried all sort of things with setCellAttribute:, but this did not seem to have any effect. Kind regards, Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
should it crash?
Hi All, I have a view (kind of a confirmation dialog) that has a button that dismisses it. When you press that button the view gets dealloced. This works fine when using mouse but if I assign a shortcut to the button it starts crashing randomly with the following message: *** -[NSButton drawCell:]: message sent to deallocated instance 0x193faf60 The reason it crashes only when using the shortcut is obviously that it case of the shortcut it invokes the action before it updates the button. Why does the button gets updated after I release the view? What am I missing here ? Mudi ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: CATextLayer not visible when added as a sub-layer . . .
Michael, Is the geometry of your added CATextLayer correct? When you add the CATextLayer to the top-layer of your NSView do you see the added layer in the sublayers array? What's the frame of the added layer? regards, douglas On Dec 28, 2008, at 12:31 AM, Michael A. Crawford wrote: I've been using multiple layers to create custom displays for my flight simulator instrumentation. The graphics sub-layers are displaying just fine but when I add a CATextLayer as sub-layer to the top-layer of my NSView, I can't see the text. If I make the CATextLayer the top-layer of the NSView, the text is visible. What subtle magic incantation am I missing in order to get text-sub- layers to display? -Michael -- The difference between genius and stupidity... ...is that genius has its limits. -- Albert Einstein ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Custom NSDictionaryController object class
I'm having a problem with NSDictionaryController. I created a class named EPCustomClass that I want to use as the object class that NSDictionaryController uses when returning objects from methods such as -newObject or -arrangedObjects. So on wake from nib, I've sent - setObjectClass:[EPCustomClass class] to my NSDictionaryController (that's instantiated in a nib) to tell it to use the new objects. But my custom methods don't seem to be used. These objects conform to the NSDictionaryControllerKeyValuePair protocol, but if I put an NSLog line inside my -setValue: method, the log line doesn't get printed at all even when I call -setValue: on one of these objects. Furthermore, objects returned by my NSDictionaryControllers methods don't seem to respond to custom methods that I've implemented in EPCustomClass; it just says that an unrecognized selector was sent to that object. What's going on here? When I call -objectClass on my NSDictionaryController, it's correctly returning EPCustomClass, but it doesn't seem to be using any of the modifications I've used to the class!? This can't possibly be normal behavior. What am I doing wrong? -- Simone ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Custom NSDictionaryController object class
The dictionary controller doesn't support customizing object class. Please file an enhancement request, including info on what behaviour you're trying to add. The dictionary controller is really designed for a specific use case - showing dictionary entries in a tavleview. - RONZILLA On Dec 28, 2008, at 2:29 PM, Simone Manganelli s...@mac.com wrote: I'm having a problem with NSDictionaryController. I created a class named EPCustomClass that I want to use as the object class that NSDictionaryController uses when returning objects from methods such as -newObject or -arrangedObjects. So on wake from nib, I've sent - setObjectClass:[EPCustomClass class] to my NSDictionaryController (that's instantiated in a nib) to tell it to use the new objects. But my custom methods don't seem to be used. These objects conform to the NSDictionaryControllerKeyValuePair protocol, but if I put an NSLog line inside my -setValue: method, the log line doesn't get printed at all even when I call -setValue: on one of these objects. Furthermore, objects returned by my NSDictionaryControllers methods don't seem to respond to custom methods that I've implemented in EPCustomClass; it just says that an unrecognized selector was sent to that object. What's going on here? When I call -objectClass on my NSDictionaryController, it's correctly returning EPCustomClass, but it doesn't seem to be using any of the modifications I've used to the class!? This can't possibly be normal behavior. What am I doing wrong? -- Simone ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/luesang%40apple.com This email sent to lues...@apple.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: should it crash?
On 29 Dec 2008, at 4:34 am, Mudi Dandan wrote: When you press that button the view gets dealloced. Why? Why does the button gets updated after I release the view? What am I missing here ? Why are you releasing the view? That's the question. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: How do I include a URL in a preprocessed Info.plist?
On 28 Dec 2008, at 11:35 pm, Michael Nickerson wrote: I know you found a way to do this that works for you, but I just wanted to point out that you can also just put it into the InfoPlist.strings file(s) and it'll work just fine (and, in the case of Sparkle, allows you to have different URLs for different localizations if you want to do that). Just so I'm clear here, I mean putting the key into the InfoPlist.strings file(s) rather than into the Info.plist file. This will work for almost any key you want to use, as long as you (or the underlying API) is using -objectForInfoDictionaryKey to look up the keys. Actually I did try that, and it didn't work for me. It certainly sounds like a good idea. Since the API in question is within Sparkle I don't know what it's using. I'll ask the question... cheers, Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Printing a range of text in a particular container --
If I have a particular range of glyphs that I want to put in, say,textContainer1, and a different (as it happens, contiguous) range I want to put in textContainer2, is there a way to do it? I've tried [layoutManager drawGlyphsForGlyphRange: glyphRangeStringOne atPoint:startPoint]; [layoutManager drawGlyphsForGlyphRange:glyphRangeStringTwo atPoint:startPoint2]; Here the first range of glyphs takes up almost all of the first container. The second range of glyphs seems to start in the position of (relative to the top left corner (isFlipped) of the second container) that it would have occupied in the first container if it had been drawn there, then continues from the top of the second container. What I would like, is to end drawing in textContainer1 after the first 'drawGlyphs..', and have the second 'drawGlyphs...' start out in the textContainer2. I can't see a way to do this using only one NSTextStorage instance From what I can tell, it would seem to require two NSTextStorage instances with corresponding layout managers and textContainers. It seems I'm missing something. I need a method that works with 10.4, by the way. Best, John Velman ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Crash when sorting tree bound to NSOutlineView
On Dec 27, 2008, at 11:19 AM, Markus Spoettl wrote: The crash goes away. However, I have a feeling that this may be pure coincidence. Even more so as the crash also goes way if the node inserted is not on that particular location in the tree or if another node gets inserted somewhere else first. All very strange. This of course turned out to be a fluke and the crash reappeared promptly with a slightly different tree configuration. Turns out - not very surprisingly - that I'm doing something that the outline doesn't like: The outline view is bound via a NSTreeController and I'm observing the controller's -arrangedObjects property. When a KVO notification is delivered, I go through the outline and expand certain nodes. This all works well except for when the tree gets sorted. This causes an KVO notification but apparently the outline doesn't like to get its tree nodes expanded at this stage. I've done some digging with NSZombieEnabled and CFZombieLevel and it appears that NSOutlineView releases an internal treenode due to the sorting which is still accessible (but garbage) via -itemAtRow: When this happens I get this console entry 12/28/08 1:38:37 PM myApp[8993] *** -[NSTreeControllerTreeNode retain]: message sent to deallocated instance 0x166e0920 In the course of debugging this I also got assertions in AppKit: 12/28/08 12:41:54 PM myApp[8615] *** Assertion failure in - [_NSBindingAdaptor outlineColumn:willDisplayCell:row:], /SourceCache/ AppKit/AppKit-949.43/Binding.subproj/_NSBindingAdaptor.m:759 I guess I can understand that things get complicated when you mess with the expanded items during a sort which changes the nodes arrangements. Fair enough. The question is how can I ensure a certain node stays expanded when its root nodes array gets sorted programatically. Apparently NSOutlineView throws away all the nodes that are being sorted and creates new ones which makes it loose the expanded state. Hints appreciated! Regards Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
A Mac App helper NSStatusItem - how to share preferences
Folks; I have an application which will have an optional helper NSStatusItem. The statusItem is a stand-alone application which can be installed as a LoginItem. I want this status item to be able to read the preferences file from the application. The user sets a number of preferences in the normal app which influence both how the app and the status item should behave. I'm under the clear impression that I should not use the same bundleIdentifer for the application and the statusItem. They could both be running at the same time... Yet the bundleIdentifier seems to be the key to the file that [NSUserDefaults sharedDefaults] opens.. This not a managed environment nor is this issue related to users or hosts, so it doesn't seem that CFPreferences is called for (or even helps!) How can I get the statusItem to read the application's preferences? Thanks! Steve ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: should it crash?
On 29 Dec 2008, at 12:08 pm, Mudi Dandan wrote: This is a overwriting confirmation dialog for file copying (very much like Finder's) and I'm releasing the view because it's not needed anymore after the user has chosen. Terminology matters. By 'view' do you mean panel/window? I took 'view' to mean an NSView, i.e. the button. 8. remove and release panel 9. ??? Update the button and crash Why are these steps in this order? In fact why do you even need to update the button at this point at all - its window has gone. When the window is released it releases all its subviews, including the button. Just leave out step 9. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Overriding NSHTTPCookieStorage for WebView
Hello, I'm trying to make my own cookie storage system for WebView and to do that I've found that I need to override NSHTTPCookieStorage but when I do that how can I make webview use my overridden one? I've already wrote the cookie system, following the rules of cookie security and all, I just need to get this working... Thanks for the help, Mr. Gecko ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: A Mac App helper NSStatusItem - how to share preferences
On Sun, Dec 28, 2008 at 8:41 PM, Steve Cronin steve_cro...@mac.com wrote: This not a managed environment nor is this issue related to users or hosts, so it doesn't seem that CFPreferences is called for (or even helps!) In fact, CFPreferences is exactly what you need. Apple has some sample code describing how to do exactly what you want: http://developer.apple.com/documentation/CoreFOundation/Conceptual/CFPreferences/Tasks/UsingLowAPI.html#//apple_ref/doc/uid/20001170 --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: should it crash?
On 29 Dec 2008, at 12:08 pm, Mudi Dandan wrote: This is a overwriting confirmation dialog for file copying (very much like Finder's) and I'm releasing the view because it's not needed anymore after the user has chosen. Terminology matters. By 'view' do you mean panel/window? I took 'view' to mean an NSView, i.e. the button. Sorry for the confusion. Actually it's NSViewController with a view (this view has the buttons on it) which I call panel/view inconsistently. When user confirmation needed I create a NSViewController and add it's view to a window and display it to the user. 8. remove and release panel Here I should have written remove the NSView from the window and release it's NSViewcontroller 9. ??? Update the button and crash Why are these steps in this order? In fact why do you even need to update the button at this point at all - its window has gone. When the window is released it releases all its subviews, including the button. Just leave out step 9. Update is done by the system not by me. I guess it just want to redraw the button after the event. I learned that if do step 7. in the button's action handler everything works fine. Here is a stacktrace: *** -[NSButton drawCell:]: message sent to deallocated instance 0x5cd5f0 .. .. .. #0 0x95ddc907 in ___forwarding___ () #1 0x95ddca12 in __forwarding_prep_0___ () #2 0x9604eae6 in -[NSButtonCell performClick:] () #3 0x96021e81 in -[NSButton performKeyEquivalent:] () #4 0x96021cee in -[NSControl _performKeyEquivalent:conditionally:] () #5 0x96021bba in -[NSView performKeyEquivalent:] () #6 0x96021bba in -[NSView performKeyEquivalent:] () #7 0x96021bba in -[NSView performKeyEquivalent:] () #8 0x96021bba in -[NSView performKeyEquivalent:] () #9 0x96021bba in -[NSView performKeyEquivalent:] () #10 0x96021bba in -[NSView performKeyEquivalent:] () #11 0x96021923 in -[NSWindow performKeyEquivalent:] () #12 0x96183336 in -[NSWindow keyDown:] () #13 0x95ffdec7 in forwardMethod () #14 0x95ffdec7 in forwardMethod () #15 0x95ffdec7 in forwardMethod () #16 0x95ffdec7 in forwardMethod () #17 0x96108917 in -[NSControl keyDown:] () #18 0x95f723a5 in -[NSWindow sendEvent:] () #19 0x95f3e311 in -[NSApplication sendEvent:] () #20 0x95e9bd0f in -[NSApplication run] () #21 0x95e68f14 in NSApplicationMain () #22 0x276e in start () ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Crash when sorting tree bound to NSOutlineView
On Dec 28, 2008, at 6:07 PM, Kyle Sluder wrote: Is the sorting a property of your model or of the view? If the latter, why not use a sort descriptor? If the former, try using sort descriptors and then wiring up a data source to the outline view and implementing -outlineView:sortDescriptorsDidChange: to propagate the sort back to the model. HTH, It did! Thanks very much, sometimes is so incredibly difficult to see the most obvious things. Thanks again! Markus -- __ Markus Spoettl smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Find with Nonspacing_Mark
On 29 Dec 2008, at 03:02, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I have a NSTextView which contains บุ that is: THAI CHARACTER BO BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a vowel. When I use the Find Panel to search for บ (using Contains or: Starts with) nothing is found. Same in TextEdit; same with any character + Nonspacing_Mark. When I enter a + COMBINING DIAERESIS and search for ä (LATIN SMALL LETTER A WITH DIAERESIS) the character, which looks like ä is found. Searching for a does not find it. This makes some sense. But to treat นุ as one letter is just plain silly and quite wrong. How can I tell the Find Panel (or the NSTextView) to find my characters, even if they are followed by some other character? 10.5.6 I tried this: NSString *bu = @บุ; NSString *ba = @บ; NSRange ra = [ bu rangeOfString: ba ]; if ( ra.location == NSNotFound ) { NSLog(@%s There is no \%...@\ in \%...@\,__FUNCTION__, ba, bu ); } else { NSLog(@%s range of \%...@\ in \%...@\ is %@,__FUNCTION__, ba, bu, NSStringFromRange(ra)); }; and got the answer: There is no บ in บุ which somehow boggles my mind (might be a problem of aforementioned mind though). What do I do now: write my own version of rangeOfString: ? I would rather like to avoid this. Kind regards, Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Find with Nonspacing_Mark
Take a look at -[NSString rangeOfString:options:range:locale:]. I'm not familiar with Thai, but NSDiacriticInsensitiveSearch seems to be the option required to make this search work. If you think that there's something wrong with this particular case, you can file a bug against Cocoa, but you might also want to file one against ICU, http://icu-project.org/. It's the ICU tables that determine string equality in Cocoa. -Ken On Mon, Dec 29, 2008 at 12:39 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: On 29 Dec 2008, at 03:02, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I have a NSTextView which contains บุ that is: THAI CHARACTER BO BAIMAI + THAI CHARACTER SARA U, which is a consonant, followed by a vowel. When I use the Find Panel to search for บ (using Contains or: Starts with) nothing is found. Same in TextEdit; same with any character + Nonspacing_Mark. When I enter a + COMBINING DIAERESIS and search for ä (LATIN SMALL LETTER A WITH DIAERESIS) the character, which looks like ä is found. Searching for a does not find it. This makes some sense. But to treat นุ as one letter is just plain silly and quite wrong. How can I tell the Find Panel (or the NSTextView) to find my characters, even if they are followed by some other character? 10.5.6 I tried this: NSString *bu = @บุ; NSString *ba = @บ; NSRange ra = [ bu rangeOfString: ba ]; if ( ra.location == NSNotFound ) { NSLog(@%s There is no \%...@\ in \%...@\,__FUNCTION__, ba, bu ); } else { NSLog(@%s range of \%...@\ in \%...@\ is %@,__FUNCTION__, ba, bu, NSStringFromRange(ra)); }; and got the answer: There is no บ in บุ which somehow boggles my mind (might be a problem of aforementioned mind though). What do I do now: write my own version of rangeOfString: ? I would rather like to avoid this. Kind regards, Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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/kenferry%40gmail.com This email sent to kenfe...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
IKImageBrowserView and the View Hierarchy
I have had a number of troubles with IKImageBrowserView not respecting other views trying to draw over the top of it. I have worked around some of the issues, but this latest I can't seem to resolve. I am trying to dim several of the views in my window by simply placing a translucent view over the top of them. This works as expected, *except* for the IKImageBrowserView... it always shines through and appears to be the top-most view. I did find that if I force the translucent view to be layer backed by - setWantLayer:YES, then the *background* of the IKImageBrowserView becomes appropriately dimmed, but the loaded images just disappear! This is *almost* repeatable with zero lines of code just using Interface Builder. You can drag an instance of IKImageBrowserView on a new window, then try to overlay another view, like an ImageWell or something. You'll see that the ImageWell is always below the IKImageBrowserView unless you tell it to be layer backed (although the layer-backing trick doesn't work in the simulator). What's going on here? IKImageBrowserView is clearly doing something fancy -- any ideas what that is and how I can get it to behave like a normal NSView? Thanks, Jeffrey ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com
Re: Printing a range of text in a particular container --
Hi John, If I have a particular range of glyphs that I want to put in, say,textContainer1, and a different (as it happens, contiguous) range I want to put in textContainer2, is there a way to do it? I've tried [layoutManager drawGlyphsForGlyphRange: glyphRangeStringOne atPoint:startPoint]; In general you don't really tell the text layout system what glyphs you want in which container. You'll note the documentation for the drawing method states: Draws the glyphs in the given glyph range, which must lie completely within a single text container. Under normal operation you simply give NSLayoutManager the full text and a series of connected containers/views and it figure the rest out for you. If you really must have one chunk of text displayed in one area and a second chunk in another you have these options: 1. Use a separate NSTextStorage and NSLayoutManager pair for each text chunk. 2. Separate the chunks of text in your NSTextStorage by a break character (NSFormFeedCharacter). There's also an unsavory third option where you size your NSTextContainers so the text happens to break into the second container at exactly the right point. I really wouldn't recommend this approach. One other thought: if you're really not using NSTextView and are doing all the drawing manually via NSLayoutManager, you might also be able to use a single infinitely tall NSTextContainer. That way NSLayoutManager will always be able to draw the glyph range you request. Just make sure your chunks of text are separated by a newline character so the second block's horizontal offset is flush with the rest of the text. ~Martin ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com