Re: NSTextView tab stop count
Ok. Your code works. I think the reason I couldn’t get it to work is when I was using [textView insertText:mas], causing my settings to be overridden. Thanks for help. > On 15/10/2016, at 12:22 PM, Shane Stanley wrote: > > On 15 Oct. 2016, at 12:43 am, tridiak wrote: >> >> This works up to 12. Above that, it sticks to 12. > > Are you sure you're just not seeing them because the text in some columns is > longer than you tab width? > > I just made a simple example with this: > >NSMutableAttributedString *mas = [[NSMutableAttributedString alloc] > initWithString:@"\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10\t11\t12\t13\t14\t15\t16\t17\t18\t19\t20\t21\t22\t23\t24\t25\t26\t27\t28\t29\t30"]; >NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; >NSMutableArray* ma=[NSMutableArray array]; >for (int t=0; t< 31; t++) { >[ma addObject:[[NSTextTab alloc] initWithType:NSLeftTabStopType > location:t*28.0f]]; >} >[style setTabStops:ma]; >[mas addAttribute:NSParagraphStyleAttributeName value:style > range:NSMakeRange(0,mas.length)]; >[self.textView insertText:mas]; > > It works as expected. > > -- > Shane Stanley > , > > > > ___ > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/tridiak%40ihug.co.nz > > This email sent to trid...@ihug.co.nz ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTextView tab stop count
Why can’t I use more than 12 tab stops in NSTextView (enclosed by a standard NSScrollView)? I can use less, but I need significantly more. Is it to do with the ruler? NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init]; NSMutableArray* ma=[NSMutableArray array]; for (int t=0; t< some large number; t++) { [ma addObject:[[NSTextTab alloc] initWithType:NSLeftTabStopType location:t*28.0f]]; } [style setTabStops:ma]; [mas addAttribute:NSParagraphStyleAttributeName value:style range:{0,mas.length}]; This works up to 12. Above that, it sticks to 12. Applying something similar directly to the NSTextView paragraph style has the same problem. How does Xcode & Text Wrangler pull it off? TIA Mark ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: mutable attributed string - underline clearing bold
Ignore the noise. Just clicked : Use addattribute:… message. Doh! Programming early in the morning is bad. > On 25/09/2016, at 1:57 AM, tridiak wrote: > > I have a mutable attributed string where a range is set to bold. > textFont is valid. > > NSFont* bFont=[fontManager fontWithFamily:textFont.familyName > traits:NSBoldFontMask weight:0 size:textFont.pointSize]; > [mas setAttributes:@{NSFontAttributeName:bFont} range:rge]; > > This works. > > When a set the attribute underline in a separate call that encompasses part > of or all of the bold range, the bold effect is removed and the underline > takes it’s place. > > NSDictionary* ul=@{NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle)}; > [mas setAttributes:ul range:rge2]; > > Why is the bold removed? Underline is not a font trait (unless I am wrong). > Do I have to set the bold and underline in the same call? > They are different calls because the ranges can be different. > > OS 10.11.6. XCode 7.3.1. SDK latest/10.11 > > TIA > Mark > ___ > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/tridiak%40ihug.co.nz > > This email sent to trid...@ihug.co.nz ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
mutable attributed string - underline clearing bold
I have a mutable attributed string where a range is set to bold. textFont is valid. NSFont* bFont=[fontManager fontWithFamily:textFont.familyName traits:NSBoldFontMask weight:0 size:textFont.pointSize]; [mas setAttributes:@{NSFontAttributeName:bFont} range:rge]; This works. When a set the attribute underline in a separate call that encompasses part of or all of the bold range, the bold effect is removed and the underline takes it’s place. NSDictionary* ul=@{NSUnderlineStyleAttributeName:@(NSUnderlineStyleSingle)}; [mas setAttributes:ul range:rge2]; Why is the bold removed? Underline is not a font trait (unless I am wrong). Do I have to set the bold and underline in the same call? They are different calls because the ranges can be different. OS 10.11.6. XCode 7.3.1. SDK latest/10.11 TIA Mark ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: WWDC 2016 direct download
> On 28/06/2016, at 3:05 AM, Ken Thomases wrote: > > On Jun 27, 2016, at 1:54 AM, Roland King wrote: >> >> On 27 Jun 2016, at 14:47, tridiak wrote: >>> >>> Where do you download the 2016 WWDC videos directly? >>> Or is that not possible (why)? >>> I want to watch them on my iPod touch while on work breaks. >> >> If you can’t run the WWDC app then go to developer.apple.com, find the >> videos section, find the WWDC videos section, > > I.e. <https://developer.apple.com/videos/wwdc2016/>. > >> find the one you want and on the Resources tab are links to the hi and sd >> def videos. > > Yeah, this (the downloads being on the Resources tab) is the "non-obvious" > part. > > Regards, > Ken > Got it. Thanks for 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
WWDC 2016 direct download
Where do you download the 2016 WWDC videos directly? Or is that not possible (why)? I want to watch them on my iPod touch while on work breaks. TIA ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: unicode fraction symbol in a NSTextView
> On 23/06/2016, at 5:29 AM, Steve Christensen wrote: > > Where are you specifying the text encoding of the HTML "document" passed to > NSMutableAttributedString(HTML:, documentAttributes:)? The default encoding > for HTML used to be ISO-8859-1, not UTF-8, for HTML 4 and earlier (and could > continue to be interpreted that way by NSAttributedString for compatibility). > That could explain the extra character being displayed since the string > you're passing as the HTML parameter to NSMutableAttributedString doesn't > include, for example, a charset="utf8" meta tag in its that would > specify the desired encoding. > > And, unless you're doing some extra formatting not shown in your code > snippet, is there any reason you wouldn't be initializing ats with > NSAttributedString(string:s)? > Copied from another project which uses an html document to be inserted into the NSTextView. This project did have a database which did not have an HTML layout field and I forgot to change to NSAttributedString(string:s). Found another DB which has an HTML data field (after I posted the original email), so I will drop my hand created version and use that. I don’t deal with HTML much (besides basic websites) and completely forgot about the encoding. Thanks for all the help. > >> On Jun 22, 2016, at 9:32 AM, tridiak wrote: >> >> I am setting some text to a NSTextView which includes the ‘½’ character. >> >> s = name + “ CR " >> switch (CR) { >> case 0.5: >> s=s+”½” // \u{00bd} >> case 0.33: >> s=s+"⅓" >> case 0.25: >> s=s+"¼" >> case 0.2: >> s=s+"⅕" >> case 0.17: >> s=s+"⅙" >> case 0.14: >> s=s+"⅐" >> case 0.13: >> s=s+"⅛" >> default: >> if CR<1 {s=s+String(format:"%.1f", CR)} >> else {s=s+String(format:"%.0f", CR)} >> } >> s=s+"\n” >> >> let d : NSData = s.dataUsingEncoding(NSUTF8StringEncoding)! >> let ats : NSMutableAttributedString = NSMutableAttributedString(HTML: d, >> documentAttributes: nil)! >> self.blab.textStorage?.setAttributedString(ats) >> >> >> What I see is 'Aasimar CR ½’ instead of 'Aasimar CR ½’. >> Where is the ‘Â' coming from? >> Is it the font or some swift-obj-C confusion? > ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
unicode fraction symbol in a NSTextView
I am setting some text to a NSTextView which includes the ‘½’ character. s = name + “ CR " switch (CR) { case 0.5: s=s+”½” // \u{00bd} case 0.33: s=s+"⅓" case 0.25: s=s+"¼" case 0.2: s=s+"⅕" case 0.17: s=s+"⅙" case 0.14: s=s+"⅐" case 0.13: s=s+"⅛" default: if CR<1 {s=s+String(format:"%.1f", CR)} else {s=s+String(format:"%.0f", CR)} } s=s+"\n” let d : NSData = s.dataUsingEncoding(NSUTF8StringEncoding)! let ats : NSMutableAttributedString = NSMutableAttributedString(HTML: d, documentAttributes: nil)! self.blab.textStorage?.setAttributedString(ats) What I see is 'Aasimar CR ½’ instead of 'Aasimar CR ½’. Where is the ‘Â' coming from? Is it the font or some swift-obj-C confusion? TIA ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSViewController view not showing in NScrollView
Hello. I have a window controlled by a NSWindowController subclass with a standard nsscrollview. (Outlets are connected). I load a custom view via a NSViewController subclass. (view outlet is connected). The custom view is not visible. @implementation AppDelegate - (IBAction) newWindow:(id)sender { mwc=[[MonWindowController alloc] initWithWindowNibName:@"MonsterWindow"]; subLayout=[[PRMLayout alloc] initWithNibName:@"StdLayout" bundle:nil]; subLayout.view; // force view to load. Necessary? [mwc setPRMLayout:subLayout]; [mwc showWindow:self]; }; @end @implementation MonWindowController - (void) setPRMLayout:(PRMLayout*)layout { [scrollView setDocumentView:layout.view]; }; @end Before I added in a custom NSWindowController, the window belonged to the AppDelegate (standard app template with a single window connected to AppDelegate). The window had the standard NSScrollView. When I added the custom view (NSViewController subclass and nib) to the scrollview, the custom view actually displayed. Changing to custom NSWindowController broke this somehow. What am I missing? TIA Mark ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSUserDirectory returns nil
Why does [[NSFileManager defaultManager] URLForDirectory:NSUserDirectory inDomain:NSUserDomainMask appropriateForURL:nil create:NO error:nil] return nil? [[NSFileManager defaultManager] URLsForDirectory:NSUserDirectory inDomains:NSUserDomainMask] returns an empty array. I am aware of NSHomeDir(). ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Text messages
Is there anyway of sending text messages from OS X & iOS programmatically? A google search has indicated no without setting up your own SMS server. I was wondering if anyone has had experience with us. TIA ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: modal window and quit menu item
I created a simple project that uses a modal window. The quit execution works are stated in the docs even though the window is modal. Which means I am doing something wrong. More investigating to do. On 19/10/2013, at 3:01 PM, Ken Thomases wrote: > On Oct 18, 2013, at 6:35 PM, trid...@ihug.co.nz wrote: > >> Problem : quit menu stays active >> when a window is presented using [NSApp runModal:window]. > > What is the target of the Quit menu item? What is its action method? A typical setup is that its action method is -terminate: and its target is the main NIB's File's Owner, which is the application object. > > Are you using a custom NSApplication subclass as your application object? Does it override -validateMenuItem:? If so, show us the implementation of that. No. >> Quitting causes the menu item to be permanently disabled. > >> My [NSApp applicationShouldTerminate:] delegate message postpones the application >> termination as certain cleanup code doesn't work at all when invoked >> from the message. > > Postpones how? In what sense does your cleanup code not work "when invoked from the message" (whatever that means)? > > It is normal that the Quit menu item remains disabled after -applicationShouldTerminate: returns NSTerminateLater unless and until you call -replyToApplicationShouldTerminate: with NO. Forgot about this. Have used it in other unrelated code parts. That explains a lot (to me). Does anyone know of > sp;Which do you want? In any case, if you want custom control over the Quit menu item, then you should implement -validateMenuItem: on its target. However, you should generally avoid doing that because the Quit menu item should behave as user's expect. > > I think you need to step back and explain your high-level goal. Don't get bogged down yet in implementation. Describe your desired user interaction design. > > Regards, > Ken > > I more or less know what to do now. > Thanks for 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
modal window and quit menu item
I have done a net search concerning the problem and I have found discussions on it, but no solution. Problem : quit menu stays active when a window is presented using [NSApp runModal:window]. Quitting causes the menu item to be permanently disabled. [window setPreventsApplicationTerminationWhenModal:] does not work. My [NSApp applicationShouldTerminate:] delegate message postpones the application termination as certain cleanup code doesn't work at all when invoked from the message. For now, using a normal window or an asynchronous sheet isn't an option without some annoying code rewrite. Does anyone know of a solution to either disable the quit menu item or re-enable the quit menu item. TIA ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Crash in CFPreferencesSetAppValue
Sorry about noise. Just realised CFPreferences doesn't like NSURL/CFURL. ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Crash in CFPreferencesSetAppValue
Sorry about cutoff. Don't know what happened. Let's try again (is there a maximum message size?). Hello. This piece of code causes CFPreferencesSetAppValue() to crash: - (CFDictionaryRef) createBlockSaveData { CFDictionaryRef parent=[super createBlockSaveData]; CFStringRef keys[]={CFSTR("LinkBlockURL"), CFSTR("LinkBlockDisplayName"), CFSTR("LinkBlockBrowser"), CFSTR("BlockType"), nil}; CFTypeRef values[]={url ? (__bridge CFTypeRef)(url) : CFSTR("null"), displayName ? (__bridge CFTypeRef)(displayName) : CFSTR("null"), browser ? (__bridge CFTypeRef)(browser) : CFSTR("null"), CFSTR(LKBLockTypeURL), nil}; CFMutableDictionaryRef d=CFDictionaryCreateMutableCopy(nil, 0, parent); if (url) {for (int t=0; t ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Crash in CFPreferencesSetAppValue
Hello. This piece of code causes CFPreferencesSetAppValue() to crash: - (CFDictionaryRef) createBlockSaveData { CFDictionaryRef parent=[super createBlockSaveData]; CFStringRef keys[]={CFSTR("LinkBlockURL"), CFSTR("LinkBlockDisplayName"), CFSTR("LinkBlockBrowser"), CFSTR("BlockType"), nil}; CFTypeRef values[]={url ? (__bridge CFTypeRef)(url) : CFSTR("null"), displayName ? (__bridge CFTypeRef)(displayName) : CFSTR("null"), browser ? (__bridge CFTypeRef)(browser) : CFSTR("null"), CFSTR(LKBLockTypeURL), nil}; CFMutableDictionaryRef d=CFDictionaryCreateMutableCopy(nil, 0, parent); if (url) {for (int t=0; t ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Copy problem
Have a problem with a copying error. This occurs on 10.8, not 10.7. This is for a custom installer. Basically copies a plugin (for DirTree) to a user-defined (or default) location. (gdb) po plugFile file://localhost/Users/tridiak/DTPlugInstaller.app/Contents/Resources/BunchOfFilters.bundle/ (gdb) po dest file://localhost/Users/tridiak/DTPlugin/BunchOfFilters.bundle NSFileManager* fm=[NSFileManager defaultManager]; NSError* e=nil; if ([fm fileExistsAtPath:fps]) { if (![fm removeItemAtURL:dest error:&e]) { DTShowAlert(@"DirTree Plugin Installer", @"Could not copy plugin to location due to inability to remove an old plugin of the same name."); exit(0); } } CFShow(plugFile); CFShow(dest); if (![fm copyItemAtURL:plugFile toURL:dest error:&e]) { DTShowAlert(@"DirTree Plugin Installer", [NSString stringWithFormat:@"Could not copy plugin to location due to filing system error %@.", e.localizedDescription]); exit(0); } = (gdb) po e Error Domain=NSCocoaErrorDomain Code=4 "The file “BunchOfFilters.bundle” doesn’t exist." UserInfo=0x1723a0 {NSSourceFilePathErrorKey=/Users/tridiak/DTPlugInstaller.app/Contents/Resources/BunchOfFilters.bundle, NSUserStringVariant=( Copy ), NSFilePath=/Users/tridiak/DTPlugInstaller.app/Contents/Resources/BunchOfFilters.bundle, NSDestinationFilePath=/Users/tridiak/DTPlugin/BunchOfFilters.bundle, NSUnderlyingError=0x190620 "The operation couldn’t be completed. No such file or directory"} (gdb) po [e userInfo] { NSDestinationFilePath = "/Users/tridiak/DTPlugin/BunchOfFilters.bundle"; NSFilePath = "/Users/tridiak/DTPlugInstaller.app/Contents/Resources/BunchOfFilters.bundle"; NSSourceFilePathErrorKey = "/Users/tridiak/DTPlugInstaller.app/Contents/Resources/BunchOfFilters.bundle"; NSUnderlyingError = "Error Domain=NSPOSIXErrorDomain Code=2 \"The operation couldn\U2019t be completed. No such file or directory\""; NSUserStringVariant = ( Copy ); == The problem is that the source (bundle) DOES exist. And only seems to occur on 10.8. Any ideas Mark ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: FS item in trash
On 2/10/2012, at 10:44 AM, Charles Srstka wrote: > On Oct 1, 2012, at 3:29 PM, Ken Thomases wrote: > >> On Oct 1, 2012, at 2:49 PM, tridiak wrote: >> >>> Is there an API (carbon or cocoa) to determine if an item is in the trash? >>> NSFileManager, NSFileHandle and carbon Files.h do not have anything. >> >> err = FSDetermineIfRefIsEnclosedByFolder (kOnAppropriateDisk, >> kTrashFolderType, &ref, &result); >> >> (That's an example directly out of the Leopard-era Folder Manager Reference >> docs.) > > Note that this API is deprecated in Mountain Lion. > > Charles > Ok. Thanks ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
FS item in trash
Is there an API (carbon or cocoa) to determine if an item is in the trash? NSFileManager, NSFileHandle and carbon Files.h do not have anything. Or do I just do a path search looking for ".trash"? TIA Mark ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Modal window and app Quit
On 24/08/2012, at 7:44 AM, Jens Alfke wrote: > > On Aug 23, 2012, at 12:06 PM, tridiak wrote: > >> I dismiss the panel using [NSApp stopModal]. It consists of a single OK >> button and an editable textfield (with a number formatter). >> Would the edit field being screwing things up? > > No, that all sounds reasonable. And it also sounds as though > preventsApplicationTerminationWhenModal should work, too (though I've never > used it myself.) How are you starting up the dialog? > > —Jens NSInteger r=[NSApp runModalForWindow:window]; That's how it's initiated. Window is nib based. Won't bother with it anymore. Change UI to make it a sheet. Not going to waste time on a quick & simple input. Thanks for 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Modal window and app Quit
On 24/08/2012, at 6:34 AM, Jens Alfke wrote: > > On Aug 23, 2012, at 10:52 AM, tridiak wrote: > >> I have a simple document app-wide modal window shown using [NSApp >> showModal:]. >> It works all fine and dandy. >> Problem is, if Cmd-Q is initiated, it does a highlight of the Application >> menu, makes a beep > > That's correct behavior; modal windows are supposed to disable quit. They're > generally considered bad UI for anything other than an urgent "I can't do > anything else until you response to this!" type of alert, so consider > changing your UI to avoid using one of these if you don't really need to. (If > you want the user to be able to quit while it's up, that's a sign that you > don't need it to be modal.) Sorry. Should have been more clear. I know the modal is supposed to block quit. But if I attempt quit while the modal window is up (it reaches applicationShouldTerminate:), the Quit menu item stays permanently disabled even after the window is dismissed. Also just noticed that then Quit menu item is active. The text field control is causing this? > >> and the Quit menu item becomes permanently disabled after the modal window >> has been dismissed. > > That's weird, and implies that you might be dismissing the panel incorrectly. > > —Jens I dismiss the panel using [NSApp stopModal]. It consists of a single OK button and an editable textfield (with a number formatter). Would the edit field being screwing things up? ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Modal window and app Quit
I have a simple document app-wide modal window shown using [NSApp showModal:]. It works all fine and dandy. Problem is, if Cmd-Q is initiated, it does a highlight of the Application menu, makes a beep and the Quit menu item becomes permanently disabled after the modal window has been dismissed. [window setPreventsApplicationTerminationWhenModal:NO] (or YES) doesn't help. Created a simple message to close ([NSApp stopModal]; [window close];) the window from - applicationShouldTerminate:. That doesn't help. The quit menu remains dimmed (and application doesn't quit). OS 10.7.4 (SDK 10.6. Target 10.6). TIA ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Mail server test
Mail server test ___ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com