Re: Problem in Dialog
Eduardo Gutierrez de O <[email protected]> Mon, 16 Apr 2018 12:18:30 +0200
| Newsgroups | gmane.comp.lang.realbasic.user |
|---|---|
| Message-ID | <[email protected]> |
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 > On 16 Apr 2018, at 11:35, Daniel Drijard <[email protected]> wrote: > > 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 > > > > > >> On 15 04 2018, at 21:30, Eduardo Gutierrez de O <[email protected] <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>> 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 <[email protected] <mailto:[email protected]>> 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 : >>>>>>> [email protected] <mailto:[email protected]> >>>>>>> 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 : >>>>> [email protected] <mailto:[email protected]> >>>>> 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 : >>> [email protected] <mailto:[email protected]> >>> 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 : > [email protected] <mailto:[email protected]> > Thoiry F-01710 > 48, rue des Savoies > > <PastedGraphic-2.tiff>