Opened 4 years ago

Closed 2 years ago

#12227 closed defect (fixed)

wxNotebook::AddPage() forces the containing top level window to show

Reported by: bdheller Owned by:
Priority: normal Milestone: 2.9.2
Component: wxOSX-Cocoa Version:
Keywords: wxNotebook Cc:
Blocked By: Blocking:
Patch: yes

Description

I'm using a wxPropertySheetDialog with a wxNotebook. The creation code, which calls wxNotebook::AddPage() previously worked in 2.8.x. Using the trunk version of the wxOSX-Cocoa port however, the first call to AddPage during dialog creation makes the dialog show. Its size and position has not been set to anything sensible at this point, so a blank dialog appears in the top left screen corner, which is visually unpleasing.

I tracked this down to AddPage() calling ChangePage() and eventually Show() on the selected notebook page. I have attached a patch that solves the problem for me, by postponing the call to Show() into the first call of the OnSize() handler unless the wxNotebook is already shown anyway.

Attachments (1)

wxNotebook.patch download (1.5 KB) - added by bdheller 4 years ago.

Download all attachments as: .zip

Change History (5)

Changed 4 years ago by bdheller

comment:1 Changed 4 years ago by vadz

  • Milestone set to 2.9.2

Stefan, any objections to applying this?

comment:2 Changed 4 years ago by VZ

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

(In [65078]) Postpone showing the notebook pages under wxOSX/Cocoa.

Showing the selected notebook page immediately when it's selected can result
in the top level parent of the notebook being shown prematurely, so don't do
this until the notebook itself is shown.

Closes #12227.

comment:3 Changed 2 years ago by csomor

  • Resolution fixed deleted
  • Status changed from closed to reopened

we should get a sample for this bug, as the patch introduces another problem - not every notebook is getting a OnSize event, and I cannot reproduce the problem in a simple test app ...

comment:4 Changed 2 years ago by vadz

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

Considering wxOSX changed a lot since this ticket was opened I think it must have been fixed by some other changes, so I'm closing it -- please reopen if the problem can be reproduced. Thanks!

Note: See TracTickets for help on using tickets.