I hereby claim:
- I am dystonie on github.
- I am dystonie (https://keybase.io/dystonie) on keybase.
- I have a public key whose fingerprint is B62A E3CD C216 FEE9 DB89 B769 1952 3FE7 7953 F600
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| NSOpenPanel *openPanel = [[[NSOpenPanel alloc] init] autorelease]; | |
| [openPanel setAllowsMultipleSelection:NO]; | |
| [openPanel setAllowedFileTypes:filetypes]; | |
| if ([openPanel runModal] == NSFileHandlingPanelOKButton) { | |
| //Some code to do | |
| } | |
| else { | |
| //If cancel was clicked | |
| } |
| #ifdef DEBUGX | |
| NSLog(@"%s %@", __FUNCTION__, objectToDisplay)); | |
| #endif |
| static inline NSSet *recursiveTroughtSubviews(NSView *aView, NSSet *previousResults) { | |
| NSMutableSet *tmpSet = [NSMutableSet set]; | |
| //There are objects | |
| if (aView && [aView subviews] > 0) { | |
| //Enumerate array | |
| NSArray *viewsToNavigate = [aView subviews]; | |
| //Getting plist path | |
| NSString *path = [[NSBundle mainBundle] pathForResource:plistName ofType:@"plist"]; | |
| //Alloc Dictionary | |
| NSDictionary *dictTMP = [NSDictionary dictionaryWithContentsOfFile:path]; | |
| #ifdef DEBUGX | |
| NSLog(@"%s - 3 - %@", __FUNCTION__, dictTMP); | |
| #endif |
| // -------------------------------------------------------------- | |
| //Macros | |
| #pragma mark Localization Macro | |
| #define lString(x) NSLocalizedStringFromTable(x, @"DYDocStrings", @"") |
| NSAlert *alert = [NSAlert alertWithMessageText:@"Text" defaultButton:@"OK" alternateButton:@"Cancel" otherButton:nil | |
| informativeTextWithFormat:@"%@",someLocalizedVariable]; | |
| [alert beginSheetModalForWindow:mainWindow modalDelegate:self didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) contextInfo:nil]; | |
| //didEnd: | |
| -(void)alertDidEnd:(NSAlert *)alert returnCode:(NSInteger)returnCode contextInfo:(void *)contextInfo { | |
| if (returnCode == NSAlertDefaultReturn) { | |
| //Dialogo Risposta | |
| } | |
| } |
| NSSavePanel *savePanel = [[[NSSavePanel alloc] init] autorelease]; | |
| [savePanel setAllowedFileTypes:[NSArray arrayWithObjects:@"fileType", nil]]; | |
| [savePanel setCanCreateDirectories:YES]; | |
| [savePanel setCanSelectHiddenExtension:TRUE]; | |
| [savePanel setExtensionHidden:TRUE]; | |
| [savePanel setMessage:@"Message to display"]; | |
| [savePanel setNameFieldStringValue:@"Default file name"]; | |
| [savePanel setDirectoryURL:[NSURL URLWithString:NSHomeDirectory()]]; //Change us you prefer | |
| //display the NSSavePanel | |
| NSInteger runResult = [savePanel runModal]; |
| #import <stdio.h> | |
| #import <stdarg.h> | |
| int globalLevel = 50; | |
| #define DEBUG_LOG(logLevel, format, ...) \ | |
| do { \ | |
| if ((logLevel) > globalLevel) printf((format), ##__VA_ARGS__); \ | |
| } while (0) |