Closing the GetOpenFolderItem on a Mac

  1. last year

    When I use GetOpenFolderItem on a Mac, the open dialog does not close after selecting the file. The code proceeds on, but the dialog box is still open . How do I get it to close?

    Here is my code:
    ' Reads Input Table (fIT)
    Dim sType as New FileType
    sType.Name = "text/csv"
    sType.MacType = "TEXT"
    sType.Extensions = "csv"

    Dim fIT as FolderItem = GetOpenFolderItem(stype)
    if fIT = Nil then
    Return
    end if

    Here’s an example project that works with a delegate and a separate class:
    https://drive.google.com/file/d/1yHjhQHv1HVuff_XIge2iCmLYaWXFUOs9/view?usp=sharing

    You need to have one method that takes a folderitem as input parameter and pass its delegate ((Weak)AddressOf) to the constructor together with the GetOpen Filter:

    Dim gui As New GUISavvyGetOpenFolderitem("", WeakAddressOf ProcessItem)

    Once the dialog is closed, the method – in this case ProcessItem – will be invoked.

  2. Beatrix W

    30 Jun 2018 Pre-Release Testers Europe (Germany)

    AFAIR this was mentioned a couple of times as feature from High Sierra. I don't remember the solution. Does this happen during debugging or in a built app?

  3. Debugging - I have a long way to go before this routine is ready for execution.

  4. Emile S

    30 Jun 2018 Europe (France, Strasbourg)

    Did you tried the example from the documentation ?
    (of course, changing the FileType)
    Did you put your code in a simple PushButton of a brand new project ?

  5. Beatrix W

    30 Jun 2018 Pre-Release Testers Europe (Germany)

    Feedback Case #49730

    Unfortunately, the bug isn't fixed, yet. DO NOT do the workaround. Let the GetOpenFolderitem close and then do the debugging.

    @Emile S : sigh...

  6. Ulrich B

    1 Jul 2018 Pre-Release Testers, Xojo Pro Europe (Germany, Berlin) · xo...

    This behavior was introduced by one of the internal graphics API changes – I don’t remember if it was with Sierra or High Sierra. If your code can be easily changed, simply jump to the return method via a Calllater call or similar and break there. The system needs some time to update the GUI which it did not in former macOS versions.

  7. Ulrich, thanks for the suggestion but I am not at your level of programming. Could you give me some example code?

  8. Ulrich B

    1 Jul 2018 Pre-Release Testers, Xojo Pro Answer Europe (Germany, Berlin) · xo...
    Edited last year

    Here’s an example project that works with a delegate and a separate class:
    https://drive.google.com/file/d/1yHjhQHv1HVuff_XIge2iCmLYaWXFUOs9/view?usp=sharing

    You need to have one method that takes a folderitem as input parameter and pass its delegate ((Weak)AddressOf) to the constructor together with the GetOpen Filter:

    Dim gui As New GUISavvyGetOpenFolderitem("", WeakAddressOf ProcessItem)

    Once the dialog is closed, the method – in this case ProcessItem – will be invoked.

  9. Thanks!

or Sign Up to reply!