Opened 2 years ago

Closed 19 months ago

Last modified 6 months ago

#15495 closed defect (fixed)

Disable() does not disable child controls in wxOSX

Reported by: eco Owned by: csomor
Priority: normal Milestone:
Component: wxOSX-Cocoa Version: 3.0.0
Keywords: Cc:
Blocked By: Blocking:
Patch: no


Simple to reproduce. Add a "Disable();" to any of the samples' windows with child controls. You'll see that the children remain visible enabled and you are able to interact with them. Nothing seems to happen at all when you call Disable() on a wxFrame or wxScrolledWindow (the two that I tested).

I looked into it a little bit seeing if I could make a patch.'s wxWidgetCocoaImple::Enable( bool enable ) has a branch that checks if the NSView responds to setEnabled. This check is false so setEnabled is never called on the target view.

Unfortunately I know very little about Cocoa and am not sure what to do. Seems like I'll have to go through and disable every child control manually but having Disable() work like it does on Windows would be prefered.

Change History (7)

comment:1 Changed 22 months ago by jdog

  • Version changed from 2.9.5 to 3.0.0

Confirmed with wxWidgets from trunk (3.1)

comment:2 Changed 20 months ago by csomor

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

comment:3 Changed 20 months ago by csomor

the native part is correct a NSBox or NSView cannot be disabled itself, I'll at whether wxHAS_NATIVE_ENABLED_MANAGEMENT or adding a setEnabled implementation to the native classes for the containers is better

comment:4 Changed 19 months ago by SC

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

In 76468:

using the base class wxHAS_NATIVE_ENABLED_MANAGEMENT in cocoa disabling/enabling child windows, fixes #16232, fixes #15495

comment:5 Changed 19 months ago by SC

In 76565:

(The changeset message doesn't reference this ticket)

comment:6 Changed 18 months ago by csomor

last change entry is wrongly attributed to this ticket, that change belongs to a different ticket #14269

comment:7 Changed 6 months ago by Dimitri Schoolwerth <dimitri@…>

In 8d2956100f1a2217b3c90a9f13776c395b86edcd/git-wxWidgets:

Using the base class wxHAS_NATIVE_ENABLED_MANAGEMENT in Cocoa
disabling/enabling child windows

Fixes #16232, fixes #15495.

(this is a backport of 91f25e0 from master)

Note: See TracTickets for help on using tickets.