Fix wxDirPickerCtrl wxDIRP_DIR_MUST_EXIST handling with GTK While it's true GtkFileChooserButton does not support GTK_FILE_CHOOSER_CREATE_FOLDER, we're using our own dialog, and GtkFileChooserDialog does support it.
| ... | ... | @@ -142,14 +142,18 @@ bool wxDirDialog::Create(wxWindow* parent, |
| 142 | 142 | {
|
| 143 | 143 | gtk_file_chooser_set_create_folders(
|
| 144 | 144 | m_fileChooser, !HasFlag(wxDD_DIR_MUST_EXIST));
|
| 145 | + gtk_file_chooser_set_create_folders(
|
|
| 146 | + (GtkFileChooser*)m_widget, !HasFlag(wxDD_DIR_MUST_EXIST));
|
|
| 145 | 147 | }
|
| 146 | 148 | #endif
|
| 147 | 149 | |
| 148 | 150 | // Enable multiple selection if desired
|
| 149 | 151 | gtk_file_chooser_set_select_multiple(m_fileChooser, HasFlag(wxDD_MULTIPLE));
|
| 152 | + gtk_file_chooser_set_select_multiple((GtkFileChooser*)m_widget, HasFlag(wxDD_MULTIPLE));
|
|
| 150 | 153 | |
| 151 | 154 | // Enable show hidden folders if desired
|
| 152 | 155 | gtk_file_chooser_set_show_hidden(m_fileChooser, HasFlag(wxDD_SHOW_HIDDEN));
|
| 156 | + gtk_file_chooser_set_show_hidden((GtkFileChooser*)m_widget, HasFlag(wxDD_SHOW_HIDDEN));
|
|
| 153 | 157 | |
| 154 | 158 | // local-only property could be set to false to allow non-local files to be loaded.
|
| 155 | 159 | // In that case get/set_uri(s) should be used instead of get/set_filename(s) everywhere
|
| ... | ... | @@ -310,14 +310,12 @@ bool wxDirButton::Create( wxWindow *parent, wxWindowID id, |
| 310 | 310 | |
| 311 | 311 | m_path = path;
|
| 312 | 312 | |
| 313 | - // GtkFileChooserButton does not support GTK_FILE_CHOOSER_CREATE_FOLDER
|
|
| 314 | - // thus we must ensure that the wxDD_DIR_MUST_EXIST style was given
|
|
| 315 | 313 | m_dialog = new wxDirDialog
|
| 316 | 314 | (
|
| 317 | 315 | nullptr,
|
| 318 | 316 | message,
|
| 319 | 317 | m_path.empty() ? m_initialDir : m_path,
|
| 320 | - wxGenericDirButton::GetDialogStyle(style | wxDIRP_DIR_MUST_EXIST)
|
|
| 318 | + wxGenericDirButton::GetDialogStyle(style)
|
|
| 321 | 319 | );
|
| 322 | 320 | |
| 323 | 321 | // little trick used to avoid problems when there are other GTK windows 'grabbed':
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help