Don't try creating the gripper before wxDialog is created
Don't do anything in wxDialog::SetWindowStyleFlag() if it's called before the dialog is actually created, as it happened during wxDirDialog initialization. Gripper creation failed anyhow in this case and this also resulted in a debug message from wxMSWDarkMode::AllowForWindow() as we passed it an invalid HWND.
This commit is contained in:
parent
32daebe883
commit
ca5cd2f18d
1 changed files with 4 additions and 0 deletions
|
|
@ -211,6 +211,10 @@ void wxDialog::SetWindowStyleFlag(long style)
|
|||
{
|
||||
wxDialogBase::SetWindowStyleFlag(style);
|
||||
|
||||
// Don't do anything if we're setting the style before creating the dialog.
|
||||
if ( !GetHwnd() )
|
||||
return;
|
||||
|
||||
if ( HasFlag(wxRESIZE_BORDER) )
|
||||
CreateGripper();
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue