SciViews / svDialogs

Standard Dialog Boxes for R
https://www.sciviews.org/svDialogs/
Other
8 stars 1 forks source link

"filters" do not work well in dlg_open #7

Closed Aiu-eo closed 3 years ago

Aiu-eo commented 4 years ago

I have an issue in dlg_open.

I wrote the following: fpath_md=dlg_open(title = "Select 'Prediction model ' file", multiple=FALSE,filters = dlg_filters[c("RData"),])$res

but, filter is shown only "All" in dialog box. I wonder if there would be an issue in "filters" argument. Thank you for your support.

R version 3.6.2 (2019-12-12) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17763)

phgrosjean commented 3 years ago

Hello,

Sorry for the late answer. It actually works as expected if you run this code from within RStudio, which is suppose. In the doc, it is indicated:

"filters: A specification of file filters as a nx2 matrix, or a character string with even number of items. First items is the label, second one is the filter. See dlg_filters for examples. This is currently ignored on MacOS and RStudio, since such kind of filter is defined differently there."

So, under Windows but from RStudio, filters= is ignored. You can specify dlg_open(...., filters = ...., rstudio = FALSE) to get the the intended behaviour under Windows.