Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a "select folder OR file dialog window" in REALbasic?

Tags:

realbasic

You can use

SelectFolder() to get a folder

or

GetOpenFolderitem(filter as string) to get files

but can you select either a folder or file? ( or for that matter selecting multiple files )

like image 308
Dan Avatar asked Dec 29 '25 05:12

Dan


1 Answers

The MonkeyBread plugin allows this in the OpenDialogMBS class.

http://www.monkeybreadsoftware.net/pluginhelp/navigation-opendialogmbs.shtml

OpenDialogMBS.AllowFolderSelection as Boolean
property, Navigation, MBS Util Plugin (OpenDialog), class OpenDialogMBS, Plugin version: 7.5, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.

Function: Whether folders can be selected.
Example: 
dim o as OpenDialogMBS
dim i,c as integer
dim f as FolderItem

o=new OpenDialogMBS
o.ShowHiddenFiles=true
o.PromptText="Select one or more files/folders:"
o.MultipleSelection=false
o.ActionButtonLabel="Open files/folders"
o.CancelButtonLabel="no, thanks."
o.WindowTitle="This is a window title."
o.ClientName="Client Name?"
o.AllowFolderSelection=true
o.ShowDialog

c=o.FileCount
if c>0 then
  for i=0 to c-1
    f=o.Files(i)

    FileList.List.AddRow f.AbsolutePath
  next
end if


Notes: 
Default is false.
Setting this to true on Windows or Linux has no effect there.
(Read and Write property)
like image 189
Philip Regan Avatar answered Dec 30 '25 22:12

Philip Regan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!