Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape Codes Are Visible In NSFeatureUnsupportedError Error Dialog #973

Open
TheBrokenRail opened this issue May 28, 2021 · 0 comments · May be fixed by darlinghq/darling-corefoundation#4
Labels
GUI For libraries and frameworks relating to graphics and user interface

Comments

@TheBrokenRail
Copy link
Contributor

Expected Result
The escape codes are displayed as the characters they represent.

Actual Result
They appear verbatim.

error

Steps To Reproduce

#include <Cocoa/Cocoa.h>

@interface Window : NSWindow
- (instancetype) init;
- (BOOL)windowShouldClose:(id)sender;
- (IBAction) OnButton1Click:(id)sender;
@end

@implementation Window
- (instancetype) init {
  NSButton *button1 = [[[NSButton alloc] initWithFrame:NSMakeRect(50, 225, 90, 25)] autorelease];
  [button1 setTitle:@"button1"];
  [button1 setBezelStyle:NSBezelStyleRounded];
  [button1 setTarget:self];
  [button1 setAction:@selector(OnButton1Click:)];
  [button1 setAutoresizingMask:NSViewMaxXMargin | NSViewMinYMargin];

  [super initWithContentRect:NSMakeRect(100, 100, 300, 300) styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskClosable | NSWindowStyleMaskResizable backing:NSBackingStoreBuffered defer:NO];
  [self setTitle:@"Button example"];
  [[self contentView] addSubview:button1];
  [self setIsVisible:YES];

  return self;
}

- (BOOL)windowShouldClose:(id)sender {
  [NSApp terminate:sender];
  return YES;
}

- (IBAction) OnButton1Click:(id)sender {
  NSError *error = [NSError errorWithDomain:NSCocoaErrorDomain code: NSFeatureUnsupportedError userInfo: nil];
  [NSApp presentError: error];
}
@end

int main(int argc, char* argv[]) {
  [NSApplication sharedApplication];
  [[[[Window alloc] init] autorelease] makeMainWindow];
  [NSApp run];
}
  1. Compile The Program
  2. Launch The Program
  3. Click The Button

Additional Information
The error messages are located in https://github.com/darlinghq/darling-corefoundation/blob/master/CFError.c.

System Information
Ubuntu 20.04

Software Version
Linux Kernel 5.8.0-50-generic
Darling 35534fcaa312b184145c95a543cf86c8b08d4e70
@facekapow facekapow added the GUI For libraries and frameworks relating to graphics and user interface label Jun 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI For libraries and frameworks relating to graphics and user interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants