Skip to content

+[NSButton buttonWithTitle:target:action:] and friends create buttons with unexpected bezel style #934

Description

@doganov

The factory method +[NSButton buttonWithTitle:target:action:] creates buttons with NSRoundedBezelStyle bezels:

[button setBezelStyle: NSRoundedBezelStyle];

Apparently, the goal to match macOS AppKit, which created rounded bezel buttons. Unfortunately, this leads to major difference with macOS AppKit. On macOS, the rounded bezel button is the default, so the following two buttons look the same:

NSButton *btn1 = [NSButton new];
[btn1 setTitle: @"Dummy"];

NSButton *btn2 = [NSButton buttonWithTitle: @"Dummy" target: nil action: NULL];

On GNUstep, though, they look different.

I don't question the goal of matching macOS AppKit here. But my expectation for "matching macOS AppKit" is for the new method to be just a convenience method to create the same kind of buttons as the traditional initializer does, as in AppKit.

If the current GNUstep implementation stands, paradoxically, I'll need to introduce #ifdef GNUSTEP conditions in my codebase to match the AppKit behavior.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions