Opened 14 years ago

Closed 10 years ago

Last modified 10 years ago

#1416 closed defect (fixed)

ShowModal after Show does not debug-assert

Reported by: hockkn Owned by:
Priority: normal Milestone:
Component: GUI-all Version:
Keywords: wxDialog Cc: hockkn
Blocked By: Blocking:
Patch: yes


On a wxDialog-derived window, if you call Show() and
then ShowModal(), MSW and GTK behave as if the first
Show() was not made. On Mac, the window immediately
closes when ShowModal() is called as if the window
were closed, because it checks if the window is already
shown, whereas GTK and MSW do not.

It seems that the call to ShowModal() should throw a
debug assertion if a call to Show was already made, so
that users in the future will not have to spend time
hunting this down.

Attachments (1)

show-modal.diff download (1.0 KB) - added by wojdyr 10 years ago.
assertions added

Download all attachments as: .zip

Change History (5)

comment:1 Changed 10 years ago by wojdyr

  • Component set to GUI-all
  • Keywords wxDialog added

comment:2 Changed 10 years ago by wojdyr

  • Patch set
  • Status changed from new to confirmed

This seems to be still the case. I added patch with assertions on MSW and GTK. I'm not sure if the assertions are the best solution, though.

Changed 10 years ago by wojdyr

assertions added

comment:3 Changed 10 years ago by vadz

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

Applied in a slightly modified form (use wxASSERT_MSG in both ports) as r54321, thanks.

And I do think it's the best thing to do, I don't see any valid reasons to use the same dialog both modelessly and modally.

comment:4 Changed 10 years ago by vadz

I was wrong to say that this was the best thing to do, in fact it was a wrong thing to do, see #4658 and #4664.

So I've reverted this change in r54328 and ShowModal() is now supposed to work correctly even if the dialog had been already shown.

Note: See TracTickets for help on using tickets.