#14968 closed defect (fixed)

OS X and multiple wxRB_GROUP

Reported by: rocrail Owned by: csomor
Priority: normal Milestone:
Component: wxOSX-Cocoa Version: stable-latest
Keywords: radiobuttongroups Cc:
Blocked By: Blocking:
Patch: no

Description

Hi,

I have a dialog with multiple radio button groups which works perfectly under Linux and Windows but under Mac OS X a selection in the next button group will unselect the previous button group.
http://wiki.rocrail.net/doku.php?id=can-gca2-en#setup
http://bazaar.launchpad.net/~rocrail-pr ... dlggen.cpp

It can also reproduced with the dialog sample:
http://forums.wxwidgets.org/viewtopic.php?f=1&t=36700&p=149580#p149580

I'm using wxWidgets 2.9.4 and did try also 2.9.5 with the same result.

The Windows and Linux binaries are build with 2.8.x; For Mac OS X 64 bit I must use 2.9.x.

Is it a known bug or must I define the multiple button groups in another way?

Best regards,
Rob Versluis
http://www.rocrail.net

Change History (7)

comment:1 in reply to: ↑ description Changed 22 months ago by rocrail

Replying to rocrail:

I forgot to mention the OS X version I use: 10.8.2 Mountain Lion.

comment:2 Changed 22 months ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted

this is an oddity of the native behaviour of radio buttons on OSX, when linked against 10.8 sdk cocoa does indeed treat them all as one group and deselect the others, from the release notes:

An NSButton configured as a radio button (with the -buttonType set to NSRadioButton), will now operate in a radio button group for applications linked on 10.8 and later. To have the button work in a radio group, use the same -action for each NSButton instance, and have the same superview for each button. When these conditions are met, checking one button (by changing the -state to 1), will uncheck all other buttons (by setting their -state to 0).

so currently, the easiest is either to include them in a separate superview or link against 10.7

comment:3 Changed 22 months ago by csomor

better formatting

An NSButton configured as a radio button (with the -buttonType set to NSRadioButton), 
will now operate in a radio button group for applications linked on 10.8 and later. To 
have the button work in a radio group, use the same -action for each NSButton instance, 
and have the same superview for each button. When these conditions are met, checking 
one button (by changing the -state to 1), will uncheck all other buttons (by setting 
their -state to 0).

comment:4 Changed 22 months ago by rocrail

For testing I linked wxWidgets against SDK 10.7, but that does not solve this issue.

This is my configure line:

../configure --enable-unicode --with-osx_cocoa --with-macosx-sdk=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk --with-macosx-version-min=10.6 --enable-graphics_ctx --enable-monolithic

comment:5 follow-up: Changed 22 months ago by rocrail

Another test:

All builded under OS X 10.7 works OK on 10.7 and 10.8.
All builded under OS X 10.7 linked against SDK 10.7 or SDK 10.8 does not work on 10.8.

comment:6 in reply to: ↑ 5 Changed 22 months ago by rocrail

All builded under OS X 10.7 linked against SDK 10.7 or SDK 10.8 does not work on 10.8.

Sorry, typo:
All builded under OS X 10.8 linked against SDK 10.7 or SDK 10.8 does not work on 10.8.

comment:7 Changed 17 months ago by SC

  • Resolution set to fixed
  • Status changed from accepted to closed

(In [74189]) quite ugly workaround, but even the engineers at WWDC couldn't give me a better alternative, fixes #14968

Note: See TracTickets for help on using tickets.