wxWidgets C++ wxDirDialog 显示空窗口并暂停程序
我的 C++ 代码
void MyFrame::sub_load_directory(wxCommandEvent& evt)
{
// Create a new wxDirDialog dialog
wxDirDialog* dirDialog = new wxDirDialog(this);
// Display the dialog and transfer the contents to
// the wxTextCtrl on the main frame if the user
// doesn't cancel
if (dirDialog->ShowModal() == wxID_OK) \\ Program pauses here
{
txtOutputFile->SetValue(dirDialog->GetPath());
}
dirDialog->Destroy();
}
我在 Windows 11
上使用 wxWidgets 3.1.5
,我复制了示例,如果只是暂停程序。 WxFileDialog
可以工作,所以 wxDirDialog
也应该可以工作
my C++ code
void MyFrame::sub_load_directory(wxCommandEvent& evt)
{
// Create a new wxDirDialog dialog
wxDirDialog* dirDialog = new wxDirDialog(this);
// Display the dialog and transfer the contents to
// the wxTextCtrl on the main frame if the user
// doesn't cancel
if (dirDialog->ShowModal() == wxID_OK) \\ Program pauses here
{
txtOutputFile->SetValue(dirDialog->GetPath());
}
dirDialog->Destroy();
}
Im using wxWidgets 3.1.5
on Windows 11
, ive copied the examples and if just pauses the program . WxFileDialog
works , so wxDirDialog
should also work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论