Create native buttons without any label in wxOSX/Cocoa
Since the changes ofdb9baf9aa5
the label wasn't explicitly reset to be empty on wxWindow creation because it was assumed it would already be empty if not explicitly set, but this turned out to be false for the controls using NSButton which (very helpfully) uses "Button" as its label by default and so kept this useless label if it wasn't explicitly overridden. Fix this by explicitly resetting the NSButton title after creating it, to ensure consistency between the real state of the control and what wxWidgets thinks it is. Closes #17152. (cherry picked from commitef1db7acda
)
This commit is contained in:
committed by
Paul Cornett
parent
46b534a194
commit
f0f83adecf
@@ -37,6 +37,18 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (id) initWithFrame:(NSRect) frame
|
||||
{
|
||||
self = [super initWithFrame:frame];
|
||||
|
||||
// NSButton uses "Button" as its title by default which is inconvenient as
|
||||
// wxWidgets expects the control to not have any default label, so reset it
|
||||
// here to resolve this mismatch.
|
||||
[self setTitle:@""];
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (int) intValue
|
||||
{
|
||||
switch ( [self state] )
|
||||
|
Reference in New Issue
Block a user