Eduardo,
I used precisely what you proposed me, though adding an MsgBox just before your GetOpenFolderItem reference:
MsgBox("Open tried ")
f = GetOpenFolderItem(jpegType + pngType)
The same problem results: I get an empty, transparent window. Curiously, clicking this window on its top-middle shows a list of parent folders (copied here), at it would, I think, when the standard Dialog would show up. Clicking this window on its down-left gives me a small window about a ânew folderâ as I would get in the standard Dialog.
Thus, it seems that the standard Dialog window is simply missing in my empty window. I wonder why this is and how to cure it. Would this be a XOJO problem ?
Daniel
[cid:F4F94DB2-9D74-479C-A718-***@home]
On 15 04 2018, at 21:30, Eduardo Gutierrez de O <***@mac.com<mailto:***@mac.com>> wrote:
Daniel,
You're right. I meant to paste a snippet from one of my apps and by mistake I pasted from a custom one.
Nonetheless, the important part is that you need to share the bit of code giving you trouble. Otherwise it's shooting in the dark.
For what it's worth, the User Guide example works ok for me:
Dim f As FolderItem
Dim m As New Movie
Dim jpegType As New FileType
jpegType.Name = "image/jpeg"
jpegType.MacType = "JPEG"
jpegType.Extensions = "jpg;jpeg"
Dim pngType As New FileType
pngType.Name = "image/png"
pngType.MacType = "PNG "
pngType.Extensions = "png"
f = GetOpenFolderItem(jpegType + pngType)
If f<> Nil Then
MsgBox("Open worked. File is "+f.NativePath)
Else
MsgBox("Open failed.")
End If
I just created a new project and assigned this to the "Action" event of a simple button. It then shows only PNG and JPG files and complains if I don't pick anything.
Eduo
On 15 Apr 2018, at 19:32, Daniel Drijard <***@cern.ch<mailto:***@cern.ch>> wrote:
Eduardo,
You mention 2 functions (or commands ?), SetupOpenDialog and DealWithFile, which I do not know and which are declared as well unknown by the current HELP of XOJO.
Daniel
On 15 04 2018, at 18:51, Eduardo Gutierrez de O <***@mac.com<mailto:***@mac.com>> wrote:
I think you're talking about different things.
James is talking about Getfolderitem, which allows you to define a folderitem from a path.
OpenDialog (and FolderItemDialog, for a customizable version) is defines into, and opens, its own modal window.
Without seeing a bit of your code it's impossible to find what you may be missing
dim o as opendialog
dim f,r as folderitem
o = new opendialog
o.prompttext = "Select a file to open"
SetupOpenDialog(o)
r = o.showmodal
if r <> nil then
f = o.result
MsgBox "Selected file is "+f.name
end
(with "DealWithFile" being a function to deal with the file :D )
Eduo
On 15 Apr 2018, at 17:17, Daniel Drijard <***@cern.ch<mailto:***@cern.ch>> wrote:
Hello, james
GetFolderItem will not allow me to choose a file inside a directory as a Dialog will instead.
Daniel
On 15 04 2018, at 17:10, Jim Wagner <***@comcast.net<mailto:***@comcast.net>> wrote:
Hello, Daniel -
That has never been how you access the file system. Try GetFolderItem() or one of its relatives.
Jim
James Wagner
Oregon Research Electronics
http://www.orelectronics.net<http://www.orelectronics.net/>
On Apr 15, 2018, at 7:21 AM, Daniel Drijard <***@cern.ch<mailto:***@cern.ch>> wrote:
I create a Dialog by OpenDialog, then define a starting Directory, then trigger ShowModal(). I get an empty window, transparent and movable which does not show the Directory I defined.
Any clue ? Thanks in advance.
I use an iMac with Sierra
Daniel
Daniel Drijard
Thoiry téléphone :
04 50 41 22 75
international
+33/4 50 41 22 75
Courriel :
***@cern.ch<mailto:***@cern.ch>
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
Thoiry téléphone :
04 50 41 22 75
international
+33/4 50 41 22 75
Courriel :
***@cern.ch<mailto:***@cern.ch>
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
Thoiry téléphone :
04 50 41 22 75
international
+33/4 50 41 22 75
Courriel :
***@cern.ch<mailto:***@cern.ch>
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
Thoiry téléphone :
04 50 41 22 75
international
+33/4 50 41 22 75
Courriel :
***@cern.ch<mailto:***@cern.ch>
Thoiry F-01710
48, rue des Savoies