Discussion:
Problem in Dialog
Daniel Drijard
2018-04-15 14:21:56 UTC
Permalink
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
Jim Wagner
2018-04-15 15:10:00 UTC
Permalink
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/>
Post by Daniel Drijard
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
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
2018-04-15 15:17:33 UTC
Permalink
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
2018-04-15 15:29:32 UTC
Permalink
I am precisely using this. The HELP from XOJO shows how to use this starting with OpenDialog and finishing with ShowModal. This IS what I do.
Daniel

On 15 04 2018, at 17:22, Jim Wagner <***@comcast.net<mailto:***@comcast.net>> wrote:

One of that family will. A simple dialog will not.Try then FolderItemDialog.

Jim

James Wagner
Oregon Research Electronics
http://www.orelectronics.net<http://www.orelectronics.net/>




On Apr 15, 2018, at 8:17 AM, 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
Eduardo Gutierrez de O
2018-04-15 16:51:54 UTC
Permalink
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
Post by Daniel Drijard
Hello, james
GetFolderItem will not allow me to choose a file inside a directory as a Dialog will instead.
Daniel
Post by Jim Wagner
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/>
Post by Daniel Drijard
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
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
2018-04-15 17:32:05 UTC
Permalink
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
Jim Shaffer
2018-04-15 17:32:48 UTC
Permalink
Post by Daniel Drijard
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
Post by Eduardo Gutierrez de O
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
Post by Daniel Drijard
Hello, james
GetFolderItem will not allow me to choose a file inside a directory as a Dialog will instead.
Daniel
Post by Jim Wagner
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/>
Post by Daniel Drijard
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
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Eduardo Gutierrez de O
2018-04-15 19:30:48 UTC
Permalink
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
Post by Daniel Drijard
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
Post by Eduardo Gutierrez de O
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
Post by Daniel Drijard
Hello, james
GetFolderItem will not allow me to choose a file inside a directory as a Dialog will instead.
Daniel
Post by Jim Wagner
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/>
Post by Daniel Drijard
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
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
2018-04-16 09:35:53 UTC
Permalink
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
Eduardo Gutierrez de O
2018-04-16 10:18:30 UTC
Permalink
Hi, Daniel.

This may not be an option, but if you could share your project (or a smaller version of it) we could take a look at it. What you're saying sounds like either a window modified by declares to be non-standard or a glitch that may be local to your machine.

Perhaps you can create a new project and assign this function so a single button and see how that works?

I've prepared a very simple example. You can open and run it. If it shows a transparent window it's probably something set-up in your machine locally. if it works properly then it's something in your project:

https://www.dropbox.com/s/gfgbg0r09ma11q2/OpenFileDialogTest.xojo_binary_project.zip?dl=0

Eduo
Post by Daniel Drijard
Eduardo,
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
Post by Eduardo Gutierrez de O
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.
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
Post by Daniel Drijard
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
Post by Eduardo Gutierrez de O
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
Post by Daniel Drijard
Hello, james
GetFolderItem will not allow me to choose a file inside a directory as a Dialog will instead.
Daniel
Post by Jim Wagner
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/>
Post by Daniel Drijard
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
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
<PastedGraphic-2.tiff>
Markus Winter
2018-04-16 10:41:46 UTC
Permalink
Post by Daniel Drijard
The same problem results: I get an empty, transparent window. Curiously
Have you restarted the computer? If Xojo starts behaving weirdly then in 99% of cases a restart will fix it (restarting Xojo is NOT enough).

Otherwise check the project with Arbed for corruption.

Take care

MfG

Markus

Sent from my iPad
Daniel Drijard
2018-04-16 14:44:39 UTC
Permalink
Eduardo,

I found a way to cure my problem, though not understanding it. I had an “Activate” in an EventHandler, which called a routine. I changed “Activate” to “Open” and my problem vanished (so far ? ).
I could not find much information about EventHandler in the XOJO documentation.

Thank you for the time you spent for me.

Daniel

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
Jon Ogden
2018-04-16 15:04:25 UTC
Permalink
Activate is an event that fires when a window is brought to the forefront and becomes the active window.

I’m not sure of your code, but I would think Open would be more appropriate.
Post by Daniel Drijard
Eduardo,
I found a way to cure my problem, though not understanding it. I had an “Activate” in an EventHandler, which called a routine. I changed “Activate” to “Open” and my problem vanished (so far ? ).
I could not find much information about EventHandler in the XOJO documentation.
Thank you for the time you spent for me.
Daniel
Post by Eduardo Gutierrez de O
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.
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
Post by Daniel Drijard
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
Post by Eduardo Gutierrez de O
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
Post by Daniel Drijard
Hello, james
GetFolderItem will not allow me to choose a file inside a directory as a Dialog will instead.
Daniel
Post by Jim Wagner
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/>
Post by Daniel Drijard
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
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Daniel Drijard
04 50 41 22 75
international
+33/4 50 41 22 75
Thoiry F-01710
48, rue des Savoies
Martin Gallo
2018-04-18 18:29:47 UTC
Permalink
Does anyone remember this?

I have the files and am trying to update the game for the 2017 compiler but have not done ANY programing for more than 4 years!

Can anyone help me update the files for the new version so I can play the game in High Sierra? I am so far behind the power curve I feel lost.

Thanks.

Francois Van Lerberghe
2018-04-15 16:33:43 UTC
Permalink
Perhaps try ShowModalWithIn.
With my old Real Studio 2010, ShowModal doesn't show the wanted initial directory. ShowModalWithIn do it right.

François Van Lerberghe
Thier Monty, 15 A
4570 Marchin (Belgium)
+32 (0) 85 25 08 25
Post by Daniel Drijard
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 Drijard
2018-04-15 16:40:17 UTC
Permalink
François,
This does not work any more. I think it stopped about in 2012.
Daniel
On 15 04 2018, at 18:33, Francois Van Lerberghe <***@gmail.com<mailto:***@gmail.com>> wrote:

Perhaps try ShowModalWithIn.
With my old Real Studio 2010, ShowModal doesn't show the wanted initial directory. ShowModalWithIn do it right.

François Van Lerberghe
Thier Monty, 15 A
4570 Marchin (Belgium)
+32 (0) 85 25 08 25

Le 15 avr. 2018 à 16:21, Daniel Drijard <***@cern.ch<mailto:***@cern.ch>> a écrit :

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 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
Marnaud
2018-04-16 11:18:14 UTC
Permalink
Post by Daniel Drijard
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
Are you perhaps doing that from another thread than the main thread? I had similar issues with this in the past.
(trying to send my message a second time)
Daniel Drijard
2018-04-16 12:16:17 UTC
Permalink
I do not know what you mean by “another thread than the main thread”
Daniel

On 16 04 2018, at 13:18, Marnaud <***@mac.com<mailto:***@mac.com>> wrote:


Le 15 avr. 2018 à 16:21 du soir, Daniel Drijard <***@cern.ch<mailto:***@cern.ch>> a écrit:

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

Are you perhaps doing that from another thread than the main thread? I had similar issues with this in the past.
(trying to send my message a second time)

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
Continue reading on narkive:
Loading...